Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeAddress(address string) ([]byte, error)
- func EncodeAddress(address []byte) string
- func ToInvocationAddress(address string) string
- type Attribute
- type ClaimTx
- type ContractTx
- type Fixed8
- type InvocationTx
- type Scripts
- type Serializable
- type ToJSON
- type Transaction
- func (tx *Transaction) CalcInputs(outputs []*Vout, unspent []*rpc.UTXO) ([]*Vin, []*rpc.UTXO, error)
- func (tx *Transaction) Read(reader io.Reader) error
- func (tx *Transaction) Sign(ecdsaPrivateKey *ecdsa.PrivateKey) ([]byte, string, error)
- func (tx *Transaction) String() string
- func (tx *Transaction) Write(writer io.Writer) error
- type Varint
- type Vin
- type Vout
Constants ¶
View Source
const ( GasAssert = "0x602c79718b16e442de58778e148d0b1084e3b2dffd5de6b7b16cee7969282de7" NEOAssert = "0xc56f33fc6ecfcd0c225c4ab356fee59390af8560be0e930faebe74a6daff7c9b" )
Asserts .
View Source
const ( MinerTransaction byte = 0x00 IssueTransaction byte = 0x01 ClaimTransaction byte = 0x02 EnrollmentTransaction byte = 0x20 RegisterTransaction byte = 0x40 ContractTransaction byte = 0x80 PublishTransaction byte = 0xd0 InvocationTransaction byte = 0xd1 )
Transaction types
View Source
const ( ContractHash = byte(0x00) ECDH02 = byte(0x02) ECDH03 = byte(0x03) Script = byte(0x20) Vote = byte(0x30) CertURL = byte(0x80) DescriptionURL = byte(0x81) Description = byte(90) Hash1 = byte(0xa1) Hash2 = byte(0xa2) Hash3 = byte(0xa3) Hash4 = byte(0xa4) Hash5 = byte(0xa5) Hash6 = byte(0xa6) Hash7 = byte(0xa7) Hash8 = byte(0xa8) Hash9 = byte(0xa9) Hash10 = byte(0xaa) Hash11 = byte(0xab) Hash12 = byte(0xac) Hash13 = byte(0xad) Hash14 = byte(0xae) Hash15 = byte(0xaf) Remark = byte(0xf0) Remark1 = byte(0xf1) Remark2 = byte(0xf2) Remark3 = byte(0xf3) Remark4 = byte(0xf4) Remark5 = byte(0xf5) Remark6 = byte(0xf6) Remark7 = byte(0xf7) Remark8 = byte(0xf8) Remark9 = byte(0xf9) Remark10 = byte(0xfa) Remark11 = byte(0xfb) Remark12 = byte(0xfc) Remark13 = byte(0xfd) Remark14 = byte(0xfe) Remark15 = byte(0xff) )
Attr Usage
Variables ¶
View Source
var (
ErrNoUTXO = errors.New("no enough utxo")
)
Err
Functions ¶
func ToInvocationAddress ¶
ToInvocationAddress neo wallet address to invocation address
Types ¶
type ContractTx ¶
type ContractTx Transaction
ContractTx contract transaction
func (*ContractTx) CalcInputs ¶
func (tx *ContractTx) CalcInputs(outputs []*Vout, unspent []*rpc.UTXO) error
CalcInputs .
type InvocationTx ¶
type InvocationTx Transaction
InvocationTx .
func NewInvocationTx ¶
func NewInvocationTx(script []byte, gas float64, fromScriptHash []byte, nonce []byte) *InvocationTx
NewInvocationTx .
func (*InvocationTx) CalcInputs ¶
func (tx *InvocationTx) CalcInputs(outputs []*Vout, unspent []*rpc.UTXO) error
CalcInputs .
type Serializable ¶
Serializable .
type Transaction ¶
type Transaction struct { Type byte // transaction type Version byte // tx version Extend Serializable // special transaction data type Attributes []*Attribute // transaction extra attributes Inputs []*Vin // transaction input utxos Outputs []*Vout // transaction change utxos Scripts []*Scripts // tx scripts SignData []byte // sign source data SignResult []byte // sign result TxID string // transaction id RawData []byte // raw transaction }
Transaction neo transaction object
func (*Transaction) CalcInputs ¶
func (tx *Transaction) CalcInputs(outputs []*Vout, unspent []*rpc.UTXO) ([]*Vin, []*rpc.UTXO, error)
CalcInputs calculate tx Inputs
func (*Transaction) Sign ¶
func (tx *Transaction) Sign(ecdsaPrivateKey *ecdsa.PrivateKey) ([]byte, string, error)
Sign sign transaction
func (*Transaction) String ¶
func (tx *Transaction) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.