Documentation ¶
Index ¶
- Constants
- func SignTransaction(transaction *Transaction, privKey []byte) error
- func ValidateTransaction(transaction Transaction) bool
- type ReceiptDetail
- type Receipts
- type SubTransaction
- type SubTransactions
- type Transaction
- func (tx Transaction) Bytes() []byte
- func (tx Transaction) GetFrom() []byte
- func (tx Transaction) GetNonce() int64
- func (tx Transaction) GetSign() []byte
- func (tx Transaction) GetTo() []byte
- func (tx Transaction) Msg() []byte
- func (tx *Transaction) SetSign(sign []byte)
- func (tx *Transaction) String() string
- func (tx *Transaction) TransactionId() string
- func (tx *Transaction) TxId() []byte
- type TransactionCore
- type TransactionReceipt
- type Transaction_V1
- type Transaction_V2
- type Transaction_V3
- type Transactions
Constants ¶
View Source
const ( FailType_SUCCESS = iota FailType_OUT_OF_GAS FailType_CHECK_FAIL FailType_CONTRACT_ERROR FailType_INVALID_ADDRESS FailType_INVALID_CONTRACT_ADDRESS FailType_INIT_CONTRACT_ACCOUNT_FAIL FailType_CHECK_CONTRACT_SUBTX_ERROR FailType_CONTRACT_TIMEOUT FailType_CONTRACT_UPGRADE_REFUSED )
Variables ¶
This section is empty.
Functions ¶
func SignTransaction ¶
func SignTransaction(transaction *Transaction, privKey []byte) error
func ValidateTransaction ¶
func ValidateTransaction(transaction Transaction) bool
Types ¶
type ReceiptDetail ¶
type ReceiptDetail struct { Receipt TransactionReceipt BlockNumber int64 Index int64 }
func (ReceiptDetail) Bytes ¶
func (detail ReceiptDetail) Bytes() []byte
type Receipts ¶
type Receipts []TransactionReceipt
type SubTransaction ¶
type SubTransaction struct { Parent types.HexBytes `json:"parent"` From types.HexBytes `json:"from"` To types.HexBytes `json:"to"` Amount int64 `json:"amount"` Data string `json:"data"` TokenAddress string `json:"tokenAddress"` }
func NewSubTransaction ¶
func NewSubTransaction(parent, from, to []byte, amount int64, data string, tokenAddress string) *SubTransaction
type SubTransactions ¶
type SubTransactions []SubTransaction
type Transaction ¶
type Transaction struct { From types.HexBytes `json:"from"` To types.HexBytes `json:"to"` TimeStamp int64 `json:"time"` // UnixTimeStamp Amount int64 `json:"amount"` Fee int64 `json:"fee"` Nonce int64 `json:"nonce"` Data string `json:"data"` TokenAddress string `json:"tokenAddress"` Sign types.HexBytes `json:"sign"` Additional string `json:"additional"` }
func NewTransaction ¶
func NewTransaction(from, to []byte, timestamp, amount, fee, nonce int64, data, tokenAddress string) *Transaction
func (Transaction) Bytes ¶
func (tx Transaction) Bytes() []byte
func (Transaction) GetFrom ¶
func (tx Transaction) GetFrom() []byte
func (Transaction) GetNonce ¶
func (tx Transaction) GetNonce() int64
func (Transaction) GetSign ¶
func (tx Transaction) GetSign() []byte
func (Transaction) GetTo ¶
func (tx Transaction) GetTo() []byte
func (Transaction) Msg ¶
func (tx Transaction) Msg() []byte
func (*Transaction) SetSign ¶
func (tx *Transaction) SetSign(sign []byte)
func (*Transaction) String ¶
func (tx *Transaction) String() string
func (*Transaction) TransactionId ¶
func (tx *Transaction) TransactionId() string
func (*Transaction) TxId ¶
func (tx *Transaction) TxId() []byte
type TransactionCore ¶
type TransactionReceipt ¶
type TransactionReceipt struct { TxId types.HexBytes `json:"txId"` Fee int64 `json:"fee"` Success bool `json:"success"` SubTransactions SubTransactions `json:"subTransactions"` FailType int `json:"failType"` }
func ContractRefuseTx ¶
func ContractRefuseTx(tx Transaction) *TransactionReceipt
func NewTransactionReceipt ¶
func NewTransactionReceipt(tx Transaction, success bool, failType int) TransactionReceipt
func (TransactionReceipt) Bytes ¶
func (receipt TransactionReceipt) Bytes() []byte
func (TransactionReceipt) EqualsTo ¶
func (receipt1 TransactionReceipt) EqualsTo(receipt2 TransactionReceipt) bool
type Transaction_V1 ¶
type Transaction_V1 struct { From types.HexBytes `json:"from"` To types.HexBytes `json:"to"` TimeStamp int64 `json:"time"` // UnixTimeStamp Amount int64 `json:"amount"` Fee int64 `json:"fee"` Nonce int64 `json:"nonce"` Data string `json:"data"` TokenAddress string `json:"tokenAddress"` Sign types.HexBytes `json:"sign"` }
type Transaction_V2 ¶
type Transaction_V2 struct { From types.HexBytes `json:"from"` To types.HexBytes `json:"to"` TimeStamp int64 `json:"time"` // UnixTimeStamp Amount int64 `json:"amount"` Fee int64 `json:"fee"` Nonce int64 `json:"nonce"` Data string `json:"data"` TokenAddress string `json:"tokenAddress"` Sign types.HexBytes `json:"sign"` Additional string `json:"additional"` }
type Transaction_V3 ¶
type Transactions ¶
type Transactions []Transaction
func (Transactions) Bytes ¶
func (transactions Transactions) Bytes() []byte
func (Transactions) Len ¶
func (transactions Transactions) Len() int
func (Transactions) Less ¶
func (transactions Transactions) Less(i, j int) bool
func (Transactions) QuickInsert ¶
func (transactions Transactions) QuickInsert(transaction Transaction) Transactions
func (Transactions) Swap ¶
func (transactions Transactions) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.