Documentation ¶
Index ¶
- Variables
- func CheckBaseFee(c common.Checker, args ...interface{}) (err error)
- func CheckOperationTypes(c common.Checker, args ...interface{}) (err error)
- func CheckOperations(c common.Checker, args ...interface{}) (err error)
- func CheckOverOperationsLimit(c common.Checker, args ...interface{}) (err error)
- func CheckSource(c common.Checker, args ...interface{}) (err error)
- func CheckVerifySignature(c common.Checker, args ...interface{}) (err error)
- type Body
- type Checker
- type Header
- type Pool
- func (tp *Pool) Add(tx Transaction) error
- func (tp *Pool) AddFromClient(tx Transaction) error
- func (tp *Pool) AddFromNode(tx Transaction) error
- func (tp *Pool) AvailableTransactions(transactionLimit int) []string
- func (tp *Pool) Get(hash string) (Transaction, bool)
- func (tp *Pool) GetFromSource(source string) (Transaction, bool)
- func (tp *Pool) Has(hash string) bool
- func (tp *Pool) IsSameSource(source string) (found bool)
- func (tp *Pool) Len() int
- func (tp *Pool) Remove(hashes ...string)
- func (tp *Pool) RemoveFromSources(sources ...string)
- type Transaction
- func MakeTransactionCreateAccount(networkID []byte, kpSource *keypair.Full, target string, amount common.Amount) (tx Transaction)
- func MakeTransactionPayment(networkID []byte, kpSource *keypair.Full, target string, amount common.Amount) (tx Transaction)
- func NewTransaction(source string, sequenceID uint64, ops ...operation.Operation) (tx Transaction, err error)
- func TestMakeTransaction(networkID []byte, n int) (kp *keypair.Full, tx Transaction)
- func TestMakeTransactionWithKeypair(networkID []byte, n int, srcKp *keypair.Full, targetKps ...*keypair.Full) (tx Transaction)
- func (tx Transaction) Equal(m common.Message) bool
- func (tx Transaction) GetHash() string
- func (tx Transaction) GetType() common.MessageType
- func (tx Transaction) IsEmpty() bool
- func (tx Transaction) IsValidSequenceID(sequenceID uint64) bool
- func (tx Transaction) IsValidVersion(version string) bool
- func (tx Transaction) IsWellFormed(conf common.Config) (err error)
- func (tx Transaction) Serialize() (encoded []byte, err error)
- func (tx *Transaction) Sign(kp keypair.KP, networkID []byte)
- func (tx Transaction) Source() string
- func (tx Transaction) String() string
- func (tx Transaction) TotalAmount(withFee bool) common.Amount
- func (tx Transaction) TotalBaseFee() common.Amount
- func (t *Transaction) UnmarshalJSON(b []byte) (err error)
- func (tx Transaction) Version() string
Constants ¶
This section is empty.
Variables ¶
View Source
var TransactionWellFormedCheckerFuncs = []common.CheckerFunc{ CheckOverOperationsLimit, CheckSource, CheckBaseFee, CheckOperationTypes, CheckOperations, CheckVerifySignature, }
Functions ¶
func CheckBaseFee ¶
func CheckOperationTypes ¶
func CheckOperations ¶
func CheckSource ¶
func CheckVerifySignature ¶
Types ¶
type Body ¶
type Body struct { Source string `json:"source"` Fee common.Amount `json:"fee"` SequenceID uint64 `json:"sequence_id"` Operations []operation.Operation `json:"operations"` }
func (Body) MakeHashString ¶
type Checker ¶
type Checker struct { common.DefaultChecker NetworkID []byte Transaction Transaction Conf common.Config }
type Pool ¶
type Pool struct { sync.RWMutex Pool map[string]Transaction // contains filtered or unexported fields }
func (*Pool) Add ¶
func (tp *Pool) Add(tx Transaction) error
func (*Pool) AddFromClient ¶
func (tp *Pool) AddFromClient(tx Transaction) error
func (*Pool) AddFromNode ¶
func (tp *Pool) AddFromNode(tx Transaction) error
func (*Pool) AvailableTransactions ¶
func (*Pool) GetFromSource ¶
func (tp *Pool) GetFromSource(source string) (Transaction, bool)
func (*Pool) IsSameSource ¶
func (*Pool) RemoveFromSources ¶
type Transaction ¶
func MakeTransactionPayment ¶
func NewTransaction ¶
func TestMakeTransaction ¶
func TestMakeTransaction(networkID []byte, n int) (kp *keypair.Full, tx Transaction)
func (Transaction) GetHash ¶
func (tx Transaction) GetHash() string
func (Transaction) GetType ¶
func (tx Transaction) GetType() common.MessageType
func (Transaction) IsEmpty ¶
func (tx Transaction) IsEmpty() bool
func (Transaction) IsValidSequenceID ¶
func (tx Transaction) IsValidSequenceID(sequenceID uint64) bool
func (Transaction) IsValidVersion ¶
func (tx Transaction) IsValidVersion(version string) bool
func (Transaction) IsWellFormed ¶
func (tx Transaction) IsWellFormed(conf common.Config) (err error)
func (Transaction) Serialize ¶
func (tx Transaction) Serialize() (encoded []byte, err error)
func (Transaction) Source ¶
func (tx Transaction) Source() string
func (Transaction) String ¶
func (tx Transaction) String() string
func (Transaction) TotalAmount ¶
func (tx Transaction) TotalAmount(withFee bool) common.Amount
TotalAmount returns the sum of Amount of operations.
Returns:
the total monetary value of this transaction, which is the sum of its operations, optionally with fees
Params:
withFee = If fee should be included in the total
func (Transaction) TotalBaseFee ¶
func (tx Transaction) TotalBaseFee() common.Amount
TotalBaseFee returns the minimum fee of transaction.
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(b []byte) (err error)
func (Transaction) Version ¶
func (tx Transaction) Version() string
Click to show internal directories.
Click to hide internal directories.