transaction

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TransactionNonceLength = 32
)

Variables

View Source
var DefaultCompare = CompareTxnsByFeePerSize

Functions

func CompareTxnsByFee added in v2.1.9

func CompareTxnsByFee(txn1, txn2 *Transaction) int

func CompareTxnsByFeePerSize added in v2.1.9

func CompareTxnsByFeePerSize(txn1, txn2 *Transaction) int

func DefaultHeap added in v2.1.9

func DefaultHeap(s []*Transaction) heap.Interface

func DefaultIsLowFeeTxn added in v2.1.9

func DefaultIsLowFeeTxn(txn *Transaction) bool

func DefaultSort added in v2.1.9

func DefaultSort(s []*Transaction) sort.Interface

func HashToShortHash

func HashToShortHash(hash common.Uint256, salt []byte, size uint32) []byte

func IsLowFeePerSizeTxn added in v2.1.9

func IsLowFeePerSizeTxn(txn *Transaction) bool

func IsLowFeeTxn added in v2.1.9

func IsLowFeeTxn(txn *Transaction) bool

func NewCoinbase

func NewCoinbase(sender, recipient common.Uint160, amount common.Fixed64) *pb.Coinbase

func NewDeleteName

func NewDeleteName(registrant []byte, name string) *pb.DeleteName

func NewGenerateID

func NewGenerateID(publicKey, sender []byte, regFee common.Fixed64, version int32) *pb.GenerateID

func NewIssueAsset

func NewIssueAsset(sender common.Uint160, name, symbol string, precision uint32, totalSupply common.Fixed64) *pb.IssueAsset

func NewMsgTx

func NewMsgTx(payload *pb.Payload, nonce uint64, fee common.Fixed64, attrs []byte) *pb.Transaction

func NewNanoPay

func NewNanoPay(sender, recipient common.Uint160, id uint64, amount common.Fixed64, txnExpiration, nanoPayExpiration uint32) *pb.NanoPay

func NewRegisterName

func NewRegisterName(registrant []byte, name string, fee int64) *pb.RegisterName

func NewSigChainTxn

func NewSigChainTxn(sigChain []byte, submitter common.Uint160) *pb.SigChainTxn

func NewSubscribe

func NewSubscribe(subscriber []byte, id, topic string, duration uint32, meta string) *pb.Subscribe

func NewTransferAsset

func NewTransferAsset(sender, recipient common.Uint160, amount common.Fixed64) *pb.TransferAsset

func NewTransferName

func NewTransferName(registrant []byte, receipt []byte, name string) *pb.TransferName

func NewUnsubscribe

func NewUnsubscribe(subscriber []byte, id, topic string) *pb.Unsubscribe

func Pack

func Pack(plType pb.PayloadType, payload proto.Message) (*pb.Payload, error)

func Unpack

func Unpack(payload *pb.Payload) (proto.Message, error)

Types

type SortTxnsByFee added in v2.1.9

type SortTxnsByFee []*Transaction

func (SortTxnsByFee) Len added in v2.1.9

func (s SortTxnsByFee) Len() int

func (SortTxnsByFee) Less added in v2.1.9

func (s SortTxnsByFee) Less(i, j int) bool

func (*SortTxnsByFee) Pop added in v2.1.9

func (s *SortTxnsByFee) Pop() interface{}

func (*SortTxnsByFee) Push added in v2.1.9

func (s *SortTxnsByFee) Push(x interface{})

func (SortTxnsByFee) Swap added in v2.1.9

func (s SortTxnsByFee) Swap(i, j int)

type SortTxnsByFeePerSize added in v2.1.9

type SortTxnsByFeePerSize []*Transaction

func (SortTxnsByFeePerSize) Len added in v2.1.9

func (s SortTxnsByFeePerSize) Len() int

func (SortTxnsByFeePerSize) Less added in v2.1.9

func (s SortTxnsByFeePerSize) Less(i, j int) bool

func (*SortTxnsByFeePerSize) Pop added in v2.1.9

func (s *SortTxnsByFeePerSize) Pop() interface{}

func (*SortTxnsByFeePerSize) Push added in v2.1.9

func (s *SortTxnsByFeePerSize) Push(x interface{})

func (SortTxnsByFeePerSize) Swap added in v2.1.9

func (s SortTxnsByFeePerSize) Swap(i, j int)

type SortTxnsByNonce added in v2.1.9

type SortTxnsByNonce []*Transaction

func (SortTxnsByNonce) Len added in v2.1.9

func (s SortTxnsByNonce) Len() int

func (SortTxnsByNonce) Less added in v2.1.9

func (s SortTxnsByNonce) Less(i, j int) bool

func (SortTxnsByNonce) Swap added in v2.1.9

func (s SortTxnsByNonce) Swap(i, j int)

type Transaction

type Transaction struct {
	*pb.Transaction
	// contains filtered or unexported fields
}

func NewDeleteNameTransaction

func NewDeleteNameTransaction(registrant []byte, name string, nonce uint64, fee common.Fixed64) (*Transaction, error)

func NewGenerateIDTransaction

func NewGenerateIDTransaction(publicKey, sender []byte, regFee common.Fixed64, version int32, nonce uint64, fee common.Fixed64, attrs []byte) (*Transaction, error)

func NewIssueAssetTransaction

func NewIssueAssetTransaction(sender common.Uint160, name, symbol string, totalSupply common.Fixed64, precision uint32, nonce uint64, fee common.Fixed64) (*Transaction, error)

func NewNanoPayTransaction

func NewNanoPayTransaction(sender, recipient common.Uint160, id uint64, amount common.Fixed64, txnExpiration, nanoPayExpiration uint32) (*Transaction, error)

func NewRegisterNameTransaction

func NewRegisterNameTransaction(registrant []byte, name string, nonce uint64, regFee common.Fixed64, fee common.Fixed64) (*Transaction, error)

func NewSigChainTransaction

func NewSigChainTransaction(sigChain []byte, submitter common.Uint160, nonce uint64) (*Transaction, error)

func NewSubscribeTransaction

func NewSubscribeTransaction(subscriber []byte, identifier string, topic string, duration uint32, meta string, nonce uint64, fee common.Fixed64) (*Transaction, error)

func NewTransferAssetTransaction

func NewTransferAssetTransaction(sender, recipient common.Uint160, nonce uint64, value, fee common.Fixed64) (*Transaction, error)

func NewTransferNameTransaction

func NewTransferNameTransaction(registrant []byte, to []byte, name string, nonce uint64, fee common.Fixed64) (*Transaction, error)

func NewUnsubscribeTransaction

func NewUnsubscribeTransaction(subscriber []byte, identifier string, topic string, nonce uint64, fee common.Fixed64) (*Transaction, error)

func (*Transaction) DeserializeUnsigned

func (tx *Transaction) DeserializeUnsigned(r io.Reader) error

func (*Transaction) GetInfo

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

func (*Transaction) GetMessage

func (tx *Transaction) GetMessage() []byte

func (*Transaction) GetProgramHashes

func (tx *Transaction) GetProgramHashes() ([]common.Uint160, error)

func (*Transaction) GetPrograms

func (tx *Transaction) GetPrograms() []*pb.Program

func (*Transaction) GetSize

func (tx *Transaction) GetSize() uint32

func (*Transaction) Hash

func (tx *Transaction) Hash() common.Uint256

func (*Transaction) Marshal

func (tx *Transaction) Marshal() (buf []byte, err error)

func (*Transaction) SerializeUnsigned

func (tx *Transaction) SerializeUnsigned(w io.Writer) error

Serialize the Transaction data without contracts

func (*Transaction) SetHash

func (tx *Transaction) SetHash(hash common.Uint256)

func (*Transaction) SetPrograms

func (tx *Transaction) SetPrograms(programs []*pb.Program)

func (*Transaction) ShortHash

func (tx *Transaction) ShortHash(salt []byte, size uint32) []byte

func (*Transaction) Unmarshal

func (tx *Transaction) Unmarshal(buf []byte) error

func (*Transaction) VerifySignature

func (tx *Transaction) VerifySignature() error

Jump to

Keyboard shortcuts

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