transaction

package
v1.0.8-beta Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: Apache-2.0 Imports: 12 Imported by: 10

Documentation

Index

Constants

View Source
const (
	SubscriptionsLimit      = 1000
	BucketsLimit            = 1000
	MaxSubscriptionDuration = 65535
)
View Source
const (
	TransactionNonceLength = 32
)

Variables

This section is empty.

Functions

func HashToShortHash

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

func NewMsgTx

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

func Pack

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

Types

type IPayload

type IPayload interface {
	Marshal() (data []byte, err error)
	Unmarshal(data []byte) error
}

func NewCoinbase

func NewCoinbase(sender, recipient common.Uint160, amount common.Fixed64) IPayload

func NewDeleteName

func NewDeleteName(registrant []byte, name string) IPayload

func NewGenerateID

func NewGenerateID(publicKey []byte, regFee common.Fixed64) IPayload

func NewIssueAsset

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

func NewNanoPay

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

func NewRegisterName

func NewRegisterName(registrant []byte, name string) IPayload

func NewSigChainTxn

func NewSigChainTxn(sigChain []byte, submitter common.Uint160) IPayload

func NewSubscribe

func NewSubscribe(subscriber []byte, id, topic string, bucket, duration uint32, meta string) IPayload

func NewTransferAsset

func NewTransferAsset(sender, recipient common.Uint160, amount common.Fixed64) IPayload

func Unpack

func Unpack(payload *pb.Payload) (IPayload, error)

type Transaction

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

func NewDeleteNameTransaction

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

func NewGenerateIDTransaction

func NewGenerateIDTransaction(publicKey []byte, regFee Fixed64, nonce uint64, fee Fixed64) (*Transaction, error)

func NewIssueAssetTransaction

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

func NewNanoPayTransaction

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

func NewRegisterNameTransaction

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

func NewSigChainTransaction

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

func NewSubscribeTransaction

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

func NewTransferAssetTransaction

func NewTransferAssetTransaction(sender, recipient Uint160, nonce uint64, value, fee 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() ([]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() 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 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) ToArray

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

func (*Transaction) Unmarshal

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

func (*Transaction) VerifySignature

func (txn *Transaction) VerifySignature() error

Jump to

Keyboard shortcuts

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