Documentation
¶
Overview ¶
Package transaction provides functions to work with transactions.
Index ¶
- func GetAttributes(t Transaction) []attribute.Attribute
- func GetHash(t Transaction) []byte
- func GetInputs(t Transaction) []input.Input
- func GetOutputs(t Transaction) []output.Output
- func GetReferences(t Transaction) []interface{}
- func GetScript(t Transaction) []byte
- func GetType(t Transaction) byte
- func GetUnspentCoins(t Transaction) []output.Output
- func GetWitnesses(t Transaction) []witness.Witness
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAttributes ¶
func GetAttributes(t Transaction) []attribute.Attribute
GetAttributes returns a slice of attributes for agiven transaction. Refer to attribute package on how to use them. This function uses `Neo.Transaction.GetAttributes` syscall.
func GetHash ¶
func GetHash(t Transaction) []byte
GetHash returns the hash (256 bit BE value in a 32 byte slice) of the given transaction (which also is its ID). Is uses `Neo.Transaction.GetHash` syscall.
func GetInputs ¶
func GetInputs(t Transaction) []input.Input
GetInputs returns a slice of inputs of a given Transaction. Refer to input package on how to use them. This function uses `Neo.Transaction.GetInputs` syscall.
func GetOutputs ¶
func GetOutputs(t Transaction) []output.Output
GetOutputs returns a slice of outputs of a given Transaction. Refer to output package on how to use them. This function uses `Neo.Transaction.GetOutputs` syscall.
func GetReferences ¶
func GetReferences(t Transaction) []interface{}
GetReferences returns a slice of references for a given Transaction. Elements of this slice can be casted to any of input.Input or output.Output, depending on which information you're interested in (as reference technically contains both input and corresponding output), refer to input and output package on how to use them. This function uses `Neo.Transaction.GetReferences` syscall.
func GetScript ¶ added in v0.75.0
func GetScript(t Transaction) []byte
GetScript returns the script stored in a given Invocation transaction. Calling it for any other Transaction type would lead to failure. It uses `Neo.InvocationTransaction.GetScript` syscall.
func GetType ¶
func GetType(t Transaction) byte
GetType returns the type of the given transaction. Possible values:
MinerTransaction = 0x00 IssueTransaction = 0x01 ClaimTransaction = 0x02 EnrollmentTransaction = 0x20 RegisterTransaction = 0x40 ContractTransaction = 0x80 StateType = 0x90 AgencyTransaction = 0xb0 PublishTransaction = 0xd0 InvocationTransaction = 0xd1
It uses `Neo.Transaction.GetType` syscall.
func GetUnspentCoins ¶
func GetUnspentCoins(t Transaction) []output.Output
GetUnspentCoins returns a slice of not yet spent ouputs of a given transaction. This function uses `Neo.Transaction.GetUnspentCoint` syscall.
func GetWitnesses ¶ added in v0.75.0
func GetWitnesses(t Transaction) []witness.Witness
GetWitnesses returns a slice of witnesses of a given Transaction. Refer to witness package on how to use them. This function uses `Neo.Transaction.GetWitnesses` syscall.
Types ¶
type Transaction ¶
type Transaction struct{}
Transaction represents a NEO transaction, it's an opaque data structure that can be used with functions from this package. It's similar to Transaction class in Neo .net framework.