Documentation
¶
Index ¶
- func GetTypeFromJSON(jsn []byte) string
- type BlockHash
- type BlockTransaction
- type ChangeBlock
- type DefaultBlock
- type OpenBlock
- type ReceiveBlock
- type SendBlock
- type SerializedChangeBlock
- type SerializedDefaultBlock
- type SerializedOpenBlock
- type SerializedReceiveBlock
- type SerializedSendBlock
- type SerializedUniversalBlock
- type UniversalBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTypeFromJSON ¶
Types ¶
type BlockHash ¶
type BlockHash []byte
func (BlockHash) MarshalJSON ¶
func (*BlockHash) UnmarshalJSON ¶
type BlockTransaction ¶
type BlockTransaction interface {
Serialize() ([]byte, error)
CreateProof() []byte
Hash() BlockHash
GetType() string
SetWork([]byte)
SetSignature([]byte)
SetFrontier(BlockHash)
SetBalance(*Numbers.RawAmount)
}
func CreateSignedReceiveOrOpenBlock ¶
func CreateSignedReceiveOrOpenBlock(sk *Wallet.SecretKey, source, previous []byte) (blk BlockTransaction, err error)
type ChangeBlock ¶
type ChangeBlock struct {
Previous []byte
Representative Wallet.PublicKey
DefaultBlock
}
func CreateSignedChangeBlock ¶
func (*ChangeBlock) CreateProof ¶
func (s *ChangeBlock) CreateProof() []byte
func (*ChangeBlock) Hash ¶
func (s *ChangeBlock) Hash() BlockHash
func (*ChangeBlock) Serialize ¶
func (s *ChangeBlock) Serialize() ([]byte, error)
func (*ChangeBlock) SetBalance ¶
func (s *ChangeBlock) SetBalance(n *Numbers.RawAmount)
func (*ChangeBlock) SetFrontier ¶
func (s *ChangeBlock) SetFrontier(h BlockHash)
type DefaultBlock ¶
type DefaultBlock struct {
Type string `json:"type" serialize:"string"`
Work []byte `json:"work" serialize:"hex"`
Signature []byte `json:"signature" serialize:"hex"`
}
func (*DefaultBlock) GetType ¶
func (d *DefaultBlock) GetType() string
func (*DefaultBlock) SetSignature ¶
func (d *DefaultBlock) SetSignature(s []byte)
func (*DefaultBlock) SetWork ¶
func (d *DefaultBlock) SetWork(w []byte)
type OpenBlock ¶
type OpenBlock struct {
Source []byte
Representative Wallet.PublicKey
Account Wallet.PublicKey
DefaultBlock
}
func CreateSignedOpenBlock ¶
func (*OpenBlock) CreateProof ¶
func (*OpenBlock) SetBalance ¶
func (*OpenBlock) SetFrontier ¶
type ReceiveBlock ¶
type ReceiveBlock struct {
Previous []byte
Source []byte
DefaultBlock
}
func CreateSignedReceiveBlock ¶
func CreateSignedReceiveBlock(sk *Wallet.SecretKey, source, previous []byte) (blk *ReceiveBlock, err error)
func (*ReceiveBlock) CreateProof ¶
func (s *ReceiveBlock) CreateProof() []byte
func (*ReceiveBlock) Hash ¶
func (s *ReceiveBlock) Hash() BlockHash
func (*ReceiveBlock) Serialize ¶
func (s *ReceiveBlock) Serialize() ([]byte, error)
func (*ReceiveBlock) SetBalance ¶
func (s *ReceiveBlock) SetBalance(n *Numbers.RawAmount)
func (*ReceiveBlock) SetFrontier ¶
func (s *ReceiveBlock) SetFrontier(h BlockHash)
type SendBlock ¶
type SendBlock struct {
Previous []byte
Destination Wallet.PublicKey
Balance *Numbers.RawAmount
DefaultBlock
}
func CreateSignedSendBlock ¶
func (*SendBlock) CreateProof ¶
func (*SendBlock) SetBalance ¶
func (*SendBlock) SetFrontier ¶
type SerializedChangeBlock ¶
type SerializedChangeBlock struct {
Previous string `json:"previous" serialize:"hex"`
Representative string `json:"representative" serialize:"hex"`
SerializedDefaultBlock
}
type SerializedDefaultBlock ¶
type SerializedOpenBlock ¶
type SerializedOpenBlock struct {
Source string `json:"source" serialize:"hex"`
Representative string `json:"representative" serialize:"hex"`
Account string `json:"account" serialize:"hex"`
SerializedDefaultBlock
}
type SerializedReceiveBlock ¶
type SerializedReceiveBlock struct {
Previous string `json:"previous" serialize:"hex"`
Source string `json:"source" serialize:"hex"`
SerializedDefaultBlock
}
type SerializedSendBlock ¶
type SerializedSendBlock struct {
Previous string `json:"previous" serialize:"hex"`
Destination string `json:"destination"`
Balance string `json:"balance" serialize:"hex"`
SerializedDefaultBlock
}
type SerializedUniversalBlock ¶
type SerializedUniversalBlock struct {
Account string `json:"account" serialize:"hex"`
Previous string `json:"previous" serialize:"hex"`
Representative string `json:"representative" serialize:"hex"`
Balance string `json:"balance" serialize:"hex"`
Amount string `json:"amount" serialize:"hex"`
Link string `json:"link" serialize:"hex"` // Link or Target?!
Destination string `json:"destination"`
Source string `json:"source" serialize:"hex"`
SerializedDefaultBlock
}
type UniversalBlock ¶
type UniversalBlock struct {
Account Wallet.PublicKey
Previous []byte
Representative Wallet.PublicKey
Balance *Numbers.RawAmount
Amount *Numbers.RawAmount
Destination Wallet.PublicKey `json:"destination"`
Source []byte `json:"source" serialize:"hex"`
DefaultBlock
}
func NewBlockFromJSON ¶
func NewBlockFromJSON(jsn []byte) (blk UniversalBlock, err error)
@TODO Create use JSONMarshal instead
func (*UniversalBlock) Hash ¶
func (u *UniversalBlock) Hash() BlockHash
It can change in the future, consider "Destination" as "Target".
func (*UniversalBlock) HashAsChange ¶
func (u *UniversalBlock) HashAsChange() BlockHash
func (*UniversalBlock) HashAsOpen ¶
func (u *UniversalBlock) HashAsOpen() BlockHash
func (*UniversalBlock) HashAsReceive ¶
func (u *UniversalBlock) HashAsReceive() BlockHash
func (*UniversalBlock) HashAsSend ¶
func (u *UniversalBlock) HashAsSend() BlockHash
Click to show internal directories.
Click to hide internal directories.