Documentation ¶
Index ¶
- Constants
- func Bool(buf []byte) (bool, error)
- func BytesWithUInt16Len(buf []byte) ([]byte, error)
- func PutBool(buf []byte, b bool)
- func PutBytesWithUInt16Len(buf []byte, data []byte)
- func PutStringWithUInt16Len(buf []byte, s string)
- func StringWithUInt16Len(buf []byte) (string, error)
- type Address
- type Alias
- type AssetPair
- type Attachment
- type B58Bytes
- type BinaryDataEntry
- func (e BinaryDataEntry) GetKey() string
- func (e BinaryDataEntry) GetValueType() ValueType
- func (e BinaryDataEntry) MarshalBinary() ([]byte, error)
- func (e BinaryDataEntry) MarshalJSON() ([]byte, error)
- func (e *BinaryDataEntry) UnmarshalBinary(data []byte) error
- func (e *BinaryDataEntry) UnmarshalJSON(value []byte) error
- type BlockID
- type BlockMessage
- type BlockSignature
- type BooleanDataEntry
- func (e BooleanDataEntry) GetKey() string
- func (e BooleanDataEntry) GetValueType() ValueType
- func (e BooleanDataEntry) MarshalBinary() ([]byte, error)
- func (e BooleanDataEntry) MarshalJSON() ([]byte, error)
- func (e *BooleanDataEntry) UnmarshalBinary(data []byte) error
- func (e *BooleanDataEntry) UnmarshalJSON(value []byte) error
- type BurnV1
- type CheckPointMessage
- type CheckpointItem
- type CreateAliasV1
- type DataEntry
- type DataV1
- type ExchangeV1
- type Genesis
- type GetBlockMessage
- type GetPeersMessage
- type GetSignaturesMessage
- type Handshake
- type IntegerDataEntry
- func (e IntegerDataEntry) GetKey() string
- func (e IntegerDataEntry) GetValueType() ValueType
- func (e IntegerDataEntry) MarshalBinary() ([]byte, error)
- func (e IntegerDataEntry) MarshalJSON() ([]byte, error)
- func (e *IntegerDataEntry) UnmarshalBinary(data []byte) error
- func (e *IntegerDataEntry) UnmarshalJSON(value []byte) error
- type IssueV1
- type LeaseCancelV1
- type LeaseV1
- type MassTransferEntry
- type MassTransferV1
- type OptionalAsset
- type OptionalScript
- type Order
- type OrderType
- type Payment
- type PeerInfo
- type PeersMessage
- type ProofsV1
- func (p *ProofsV1) MarshalBinary() ([]byte, error)
- func (p ProofsV1) MarshalJSON() ([]byte, error)
- func (p *ProofsV1) Sign(pos int, key crypto.SecretKey, data []byte) error
- func (p ProofsV1) String() string
- func (p *ProofsV1) UnmarshalBinary(data []byte) error
- func (p *ProofsV1) UnmarshalJSON(value []byte) error
- func (p *ProofsV1) Verify(pos int, key crypto.PublicKey, data []byte) (bool, error)
- type ReissueV1
- type ScoreMessage
- type Script
- type SetScriptV1
- type SignaturesMessage
- type SponsorshipV1
- type StringDataEntry
- func (e StringDataEntry) GetKey() string
- func (e StringDataEntry) GetValueType() ValueType
- func (e StringDataEntry) MarshalBinary() ([]byte, error)
- func (e StringDataEntry) MarshalJSON() ([]byte, error)
- func (e *StringDataEntry) UnmarshalBinary(data []byte) error
- func (e *StringDataEntry) UnmarshalJSON(value []byte) error
- type TransactionMessage
- type TransactionType
- type TransferV1
- type ValueType
- type Version
Constants ¶
const ( AddressSize = headerSize + bodySize + checksumSize MainNetScheme byte = 'W' TestNetScheme byte = 'T' DevNetScheme byte = 'D' )
const ( ContentIDGetPeers = 0x1 ContentIDPeers = 0x2 ContentIDGetSignatures = 0x14 ContentIDSignatures = 0x15 ContentIDGetBlock = 0x16 ContentIDBlock = 0x17 ContentIDScore = 0x18 ContentIDTransaction = 0x19 ContentIDCheckpoint = 0x64 )
Constants for message IDs
const (
//WavesAssetName is the default name for basic WAVES asset.
WavesAssetName = "WAVES"
)
Variables ¶
This section is empty.
Functions ¶
func BytesWithUInt16Len ¶
BytesWithUInt16Len reads from buf an array of bytes of length encoded in first 2 bytes.
func PutBytesWithUInt16Len ¶
PutBytesWithUInt16Len prepends given buf with 2 bytes of it's length.
func PutStringWithUInt16Len ¶
func StringWithUInt16Len ¶
Types ¶
type Address ¶
type Address [AddressSize]byte
func NewAddressFromBytes ¶
func NewAddressFromPublicKey ¶
func NewAddressFromString ¶
func (Address) MarshalJSON ¶
func (*Address) UnmarshalJSON ¶
type Alias ¶
func NewAliasFromBytes ¶
func NewAliasFromString ¶
func (*Alias) MarshalBinary ¶
func (Alias) MarshalJSON ¶
func (*Alias) UnmarshalBinary ¶
func (*Alias) UnmarshalJSON ¶
type AssetPair ¶
type AssetPair struct { AmountAsset OptionalAsset `json:"amountAsset"` PriceAsset OptionalAsset `json:"priceAsset"` }
AssetPair is a pair of assets in ExchangeTransaction.
type Attachment ¶
type Attachment string
Attachment represents the additional data stored in Transfer and MassTransfer transactions.
func (Attachment) MarshalJSON ¶
func (a Attachment) MarshalJSON() ([]byte, error)
MarshalJSON writes Attachment as a JSON string Value
func (Attachment) String ¶
func (a Attachment) String() string
String returns Attachment's string representation
func (*Attachment) UnmarshalJSON ¶
func (a *Attachment) UnmarshalJSON(value []byte) error
UnmarshalJSON reads Attachment from a JSON string Value
type B58Bytes ¶
type B58Bytes []byte
B58Bytes represents bytes as Base58 string in JSON
func (B58Bytes) MarshalJSON ¶
MarshalJSON writes B58Bytes Value as JSON string
func (*B58Bytes) UnmarshalJSON ¶
UnmarshalJSON reads B58Bytes from JSON string
type BinaryDataEntry ¶
BinaryDataEntry represents a key-value data entry that stores binary value.
func (BinaryDataEntry) GetKey ¶
func (e BinaryDataEntry) GetKey() string
GetKey returns the key of data entry.
func (BinaryDataEntry) GetValueType ¶
func (e BinaryDataEntry) GetValueType() ValueType
GetValueType returns the type of value (Binary) stored in an entry.
func (BinaryDataEntry) MarshalBinary ¶
func (e BinaryDataEntry) MarshalBinary() ([]byte, error)
MarshalBinary writes an entry to its byte representation.
func (BinaryDataEntry) MarshalJSON ¶
func (e BinaryDataEntry) MarshalJSON() ([]byte, error)
MarshalJSON converts an entry to its JSON representation. Note that BASE64 is used to represent the binary value.
func (*BinaryDataEntry) UnmarshalBinary ¶
func (e *BinaryDataEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary reads an entry from a binary representation.
func (*BinaryDataEntry) UnmarshalJSON ¶
func (e *BinaryDataEntry) UnmarshalJSON(value []byte) error
UnmarshalJSON converts JSON to a BinaryDataEntry structure. Value should be stored as BASE64 sting in JSON.
type BlockMessage ¶
type BlockMessage struct {
BlockBytes []byte
}
BlockMessage represents Block message
func (*BlockMessage) MarshalBinary ¶
func (m *BlockMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes BlockMessage to binary form
func (*BlockMessage) ReadFrom ¶
func (m *BlockMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads BlockMessage from io.Reader
func (*BlockMessage) UnmarshalBinary ¶
func (m *BlockMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes BlockMessage from binary from
type BlockSignature ¶
BlockSignature is a signature of a formed block
type BooleanDataEntry ¶
BooleanDataEntry represents a key-value pair that stores a bool value.
func (BooleanDataEntry) GetKey ¶
func (e BooleanDataEntry) GetKey() string
GetKey returns the key of data entry.
func (BooleanDataEntry) GetValueType ¶
func (e BooleanDataEntry) GetValueType() ValueType
GetValueType returns the data type (Boolean) of the entry.
func (BooleanDataEntry) MarshalBinary ¶
func (e BooleanDataEntry) MarshalBinary() ([]byte, error)
MarshalBinary writes a byte representation of the boolean data entry.
func (BooleanDataEntry) MarshalJSON ¶
func (e BooleanDataEntry) MarshalJSON() ([]byte, error)
MarshalJSON writes the data entry to a JSON representation.
func (*BooleanDataEntry) UnmarshalBinary ¶
func (e *BooleanDataEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary reads a byte representation of the data entry.
func (*BooleanDataEntry) UnmarshalJSON ¶
func (e *BooleanDataEntry) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from its JSON representation.
type BurnV1 ¶
type BurnV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` AssetID crypto.Digest `json:"assetId"` Amount uint64 `json:"amount"` Timestamp uint64 `json:"timestamp,omitempty"` Fee uint64 `json:"fee"` }
func NewUnsignedBurnV1 ¶
func (*BurnV1) MarshalBinary ¶
func (*BurnV1) UnmarshalBinary ¶
type CheckPointMessage ¶
type CheckPointMessage struct {
Checkpoints []CheckpointItem
}
CheckPointMessage represents a CheckPoint message
func (*CheckPointMessage) MarshalBinary ¶
func (m *CheckPointMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes CheckPointMessage to binary form
func (*CheckPointMessage) ReadFrom ¶
func (m *CheckPointMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads CheckPointMessage from io.Reader
func (*CheckPointMessage) UnmarshalBinary ¶
func (m *CheckPointMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes CheckPointMessage from binary form
type CheckpointItem ¶
type CheckpointItem struct { Height uint64 Signature BlockSignature }
CheckpointItem represents a Checkpoint
type CreateAliasV1 ¶
type CreateAliasV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Alias Alias `json:"alias"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func (*CreateAliasV1) MarshalBinary ¶
func (tx *CreateAliasV1) MarshalBinary() ([]byte, error)
func (*CreateAliasV1) UnmarshalBinary ¶
func (tx *CreateAliasV1) UnmarshalBinary(data []byte) error
type DataEntry ¶
type DataEntry interface { GetKey() string GetValueType() ValueType MarshalBinary() ([]byte, error) // contains filtered or unexported methods }
DataEntry is a common interface of all types of data entries. The interface is used to store different types of data entries in one slice.
type DataV1 ¶
type DataV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Entries []DataEntry `json:"data"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
DataV1 is first version of the transaction that puts data to the key-value storage of an account.
func NewUnsignedData ¶
NewUnsignedData creates new Data transaction without proofs.
func (*DataV1) AppendEntry ¶
AppendEntry adds the entry to the transaction.
func (*DataV1) MarshalBinary ¶
func (*DataV1) UnmarshalBinary ¶
type ExchangeV1 ¶
type ExchangeV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` BuyOrder Order `json:"order1"` SellOrder Order `json:"order2"` Price uint64 `json:"price"` Amount uint64 `json:"amount"` BuyMatcherFee uint64 `json:"buyMatcherFee"` SellMatcherFee uint64 `json:"sellMatcherFee"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func NewUnsignedExchangeV1 ¶
func NewUnsignedExchangeV1(buy, sell Order, price, amount, buyMatcherFee, sellMatcherFee, fee, timestamp uint64) (*ExchangeV1, error)
func (*ExchangeV1) MarshalBinary ¶
func (tx *ExchangeV1) MarshalBinary() ([]byte, error)
func (*ExchangeV1) UnmarshalBinary ¶
func (tx *ExchangeV1) UnmarshalBinary(data []byte) error
type Genesis ¶
type Genesis struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Signature `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` Timestamp uint64 `json:"timestamp"` Recipient Address `json:"recipient"` Amount uint64 `json:"amount"` }
func NewUnsignedGenesis ¶
func (*Genesis) GenerateSigID ¶
func (*Genesis) MarshalBinary ¶
func (*Genesis) UnmarshalBinary ¶
type GetBlockMessage ¶
type GetBlockMessage struct {
BlockID BlockID
}
GetBlockMessage represents GetBlock message
func (*GetBlockMessage) MarshalBinary ¶
func (m *GetBlockMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes GetBlockMessage to binary form
func (*GetBlockMessage) ReadFrom ¶
func (m *GetBlockMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads GetBlockMessage from io.Reader
func (*GetBlockMessage) UnmarshalBinary ¶
func (m *GetBlockMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes GetBlockMessage from binary form
type GetPeersMessage ¶
type GetPeersMessage struct{}
GetPeersMessage implements the GetPeers message from the waves protocol
func (*GetPeersMessage) MarshalBinary ¶
func (m *GetPeersMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes GetPeersMessage to binary form
func (*GetPeersMessage) ReadFrom ¶
func (m *GetPeersMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads GetPeersMessage from io.Reader
func (*GetPeersMessage) UnmarshalBinary ¶
func (m *GetPeersMessage) UnmarshalBinary(b []byte) error
UnmarshalBinary decodes GetPeersMessage from binary form
type GetSignaturesMessage ¶
type GetSignaturesMessage struct {
Blocks []BlockID
}
GetSignaturesMessage represents the Get Signatures request
func (*GetSignaturesMessage) MarshalBinary ¶
func (m *GetSignaturesMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes GetSignaturesMessage to binary form
func (*GetSignaturesMessage) ReadFrom ¶
func (m *GetSignaturesMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads GetSignaturesMessage from io.Reader
func (*GetSignaturesMessage) UnmarshalBinary ¶
func (m *GetSignaturesMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes GetSignaturesMessage from binary form
type Handshake ¶
type Handshake struct { Name string Version Version NodeName string NodeNonce uint64 DeclaredAddrBytes []byte Timestamp uint64 }
Handshake is the handshake structure of the waves protocol
func (*Handshake) MarshalBinary ¶
MarshalBinary encodes Handshake to binary form
func (*Handshake) UnmarshalBinary ¶
UnmarshalBinary decodes Handshake from binary from
type IntegerDataEntry ¶
IntegerDataEntry stores int64 value.
func (IntegerDataEntry) GetKey ¶
func (e IntegerDataEntry) GetKey() string
GetKey returns the key of data entry.
func (IntegerDataEntry) GetValueType ¶
func (e IntegerDataEntry) GetValueType() ValueType
GetValueType returns the value type of the entry.
func (IntegerDataEntry) MarshalBinary ¶
func (e IntegerDataEntry) MarshalBinary() ([]byte, error)
MarshalBinary marshals the integer data entry in its bytes representation.
func (IntegerDataEntry) MarshalJSON ¶
func (e IntegerDataEntry) MarshalJSON() ([]byte, error)
MarshalJSON writes a JSON representation of integer data entry.
func (*IntegerDataEntry) UnmarshalBinary ¶
func (e *IntegerDataEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary reads binary representation of integer data entry to the structure.
func (*IntegerDataEntry) UnmarshalJSON ¶
func (e *IntegerDataEntry) UnmarshalJSON(value []byte) error
UnmarshalJSON reads an integer data entry from its JSON representation.
type IssueV1 ¶
type IssueV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Name string `json:"name"` Description string `json:"description"` Quantity uint64 `json:"quantity"` Decimals byte `json:"decimals"` Reissuable bool `json:"reissuable"` Timestamp uint64 `json:"timestamp,omitempty"` Fee uint64 `json:"fee"` }
func NewUnsignedIssueV1 ¶
func (*IssueV1) MarshalBinary ¶
func (*IssueV1) UnmarshalBinary ¶
type LeaseCancelV1 ¶
type LeaseCancelV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` LeaseID crypto.Digest `json:"leaseId"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func (*LeaseCancelV1) MarshalBinary ¶
func (tx *LeaseCancelV1) MarshalBinary() ([]byte, error)
func (*LeaseCancelV1) UnmarshalBinary ¶
func (tx *LeaseCancelV1) UnmarshalBinary(data []byte) error
type LeaseV1 ¶
type LeaseV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Recipient Address `json:"recipient"` Amount uint64 `json:"amount"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func NewUnsignedLeaseV1 ¶
func (*LeaseV1) MarshalBinary ¶
func (*LeaseV1) UnmarshalBinary ¶
type MassTransferEntry ¶
type MassTransferEntry struct { Recipient Address `json:"recipient"` Amount uint64 `json:"amount"` }
func (*MassTransferEntry) MarshalBinary ¶
func (e *MassTransferEntry) MarshalBinary() ([]byte, error)
func (*MassTransferEntry) UnmarshalBinary ¶
func (e *MassTransferEntry) UnmarshalBinary(data []byte) error
type MassTransferV1 ¶
type MassTransferV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Asset OptionalAsset `json:"assetId"` Transfers []MassTransferEntry `json:"transfers"` Timestamp uint64 `json:"timestamp,omitempty"` Fee uint64 `json:"fee"` Attachment Attachment `json:"attachment,omitempty"` }
func NewUnsignedMassTransferV1 ¶
func NewUnsignedMassTransferV1(senderPK crypto.PublicKey, asset OptionalAsset, transfers []MassTransferEntry, fee, timestamp uint64, attachment string) (*MassTransferV1, error)
func (*MassTransferV1) MarshalBinary ¶
func (tx *MassTransferV1) MarshalBinary() ([]byte, error)
func (*MassTransferV1) UnmarshalBinary ¶
func (tx *MassTransferV1) UnmarshalBinary(data []byte) error
type OptionalAsset ¶
OptionalAsset represents an optional asset identification
func NewOptionalAssetFromString ¶
func NewOptionalAssetFromString(s string) (*OptionalAsset, error)
NewOptionalAssetFromString creates an OptionalAsset structure from its string representation.
func (*OptionalAsset) MarshalBinary ¶
func (a *OptionalAsset) MarshalBinary() ([]byte, error)
MarshalBinary marshals the optional asset to its binary representation.
func (OptionalAsset) MarshalJSON ¶
func (a OptionalAsset) MarshalJSON() ([]byte, error)
MarshalJSON writes OptionalAsset as a JSON string Value
func (OptionalAsset) String ¶
func (a OptionalAsset) String() string
String method converts OptionalAsset to its text representation
func (*OptionalAsset) UnmarshalBinary ¶
func (a *OptionalAsset) UnmarshalBinary(data []byte) error
UnmarshalBinary reads the OptionalAsset structure from its binary representation.
func (*OptionalAsset) UnmarshalJSON ¶
func (a *OptionalAsset) UnmarshalJSON(value []byte) error
UnmarshalJSON reads OptionalAsset from a JSON string Value
type OptionalScript ¶
type OptionalScript struct {
MaybeScript *Script
}
OptionalScript can be used then the script value is optional.
type Order ¶
type Order struct { ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` MatcherPK crypto.PublicKey `json:"matcherPublicKey"` AssetPair AssetPair `json:"assetPair"` OrderType OrderType `json:"orderType"` Price uint64 `json:"price"` Amount uint64 `json:"amount"` Timestamp uint64 `json:"timestamp"` Expiration uint64 `json:"expiration"` MatcherFee uint64 `json:"matcherFee"` }
Order is an order created and signed by user. Two matched orders builds up an Exchange transaction.
func NewUnsignedOrder ¶
func NewUnsignedOrder(senderPK, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64) (*Order, error)
NewUnsignedOrder creates the new unsigned order.
func (*Order) MarshalBinary ¶
MarshalBinary writes order to its bytes representation.
func (*Order) UnmarshalBinary ¶
UnmarshalBinary reads an order from its binary representation.
type OrderType ¶
type OrderType byte
OrderType an alias for byte that encodes the type of Order (BUY|SELL).
func (OrderType) MarshalJSON ¶
MarshalJSON writes value of OrderType to JSON representation.
func (*OrderType) UnmarshalJSON ¶
UnmarshalJSON reads the OrderType value from JSON value.
type Payment ¶
type Payment struct { Type TransactionType `json:"type"` Version byte `json:"version"` ID *crypto.Signature `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Recipient Address `json:"recipient"` Amount uint64 `json:"amount"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp"` }
func NewUnsignedPayment ¶
func (*Payment) MarshalBinary ¶
func (*Payment) UnmarshalBinary ¶
type PeerInfo ¶
PeerInfo represents the address of a single peer
func (*PeerInfo) MarshalBinary ¶
MarshalBinary encodes PeerInfo message to binary form
func (PeerInfo) MarshalJSON ¶
MarshalJSON writes PeerInfo Value as JSON string
func (*PeerInfo) UnmarshalBinary ¶
UnmarshalBinary decodes PeerInfo message from binary form
func (*PeerInfo) UnmarshalJSON ¶
UnmarshalJSON reads PeerInfo from JSON string
type PeersMessage ¶
type PeersMessage struct {
Peers []PeerInfo
}
PeersMessage represents the peers message
func (*PeersMessage) MarshalBinary ¶
func (m *PeersMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes PeersMessage message to binary form
func (*PeersMessage) ReadFrom ¶
func (m *PeersMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads PeersMessage from io.Reader
func (*PeersMessage) UnmarshalBinary ¶
func (m *PeersMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes PeersMessage from binary form
type ProofsV1 ¶
ProofsV1 is a collection of proofs.
func (*ProofsV1) MarshalBinary ¶
MarshalBinary writes the proofs to its binary form.
func (ProofsV1) MarshalJSON ¶
MarshalJSON writes the proofs to JSON.
func (*ProofsV1) UnmarshalBinary ¶
UnmarshalBinary reads the proofs from its binary representation.
func (*ProofsV1) UnmarshalJSON ¶
UnmarshalJSON reads the proofs from JSON.
type ReissueV1 ¶
type ReissueV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` AssetID crypto.Digest `json:"assetId"` Quantity uint64 `json:"quantity"` Reissuable bool `json:"reissuable"` Timestamp uint64 `json:"timestamp,omitempty"` Fee uint64 `json:"fee"` }
func NewUnsignedReissueV1 ¶
func (*ReissueV1) MarshalBinary ¶
func (*ReissueV1) UnmarshalBinary ¶
type ScoreMessage ¶
type ScoreMessage struct {
Score []byte
}
ScoreMessage represents Score message
func (*ScoreMessage) MarshalBinary ¶
func (m *ScoreMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes ScoreMessage to binary form
func (*ScoreMessage) ReadFrom ¶
func (m *ScoreMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads ScoreMessage from io.Reader
func (*ScoreMessage) UnmarshalBinary ¶
func (m *ScoreMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes ScoreMessage from binary form
type SetScriptV1 ¶
type SetScriptV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` ChainID byte `json:"-"` SenderPK crypto.PublicKey `json:"senderPublicKey"` Script []byte `json:"script"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
SetScriptV1 is a transaction to set smart script on an account.
func NewUnsignedSetScriptV1 ¶
func NewUnsignedSetScriptV1(chain byte, senderPK crypto.PublicKey, script []byte, fee, timestamp uint64) (*SetScriptV1, error)
NewUnsignedSetScriptV1 creates new unsigned SetScriptV1 transaction.
func (*SetScriptV1) MarshalBinary ¶
func (tx *SetScriptV1) MarshalBinary() ([]byte, error)
MarshalBinary writes SetScriptV1 transaction to its bytes representation.
func (*SetScriptV1) NonEmptyScript ¶
func (tx *SetScriptV1) NonEmptyScript() bool
NonEmptyScript returns true if transaction contains non-empty script.
func (*SetScriptV1) Sign ¶
func (tx *SetScriptV1) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*SetScriptV1) UnmarshalBinary ¶
func (tx *SetScriptV1) UnmarshalBinary(data []byte) error
UnmarshalBinary reads SetScriptV1 transaction from its binary representation.
type SignaturesMessage ¶
type SignaturesMessage struct {
Signatures []BlockSignature
}
SignaturesMessage represents Signatures message
func (*SignaturesMessage) MarshalBinary ¶
func (m *SignaturesMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes SignaturesMessage to binary form
func (*SignaturesMessage) ReadFrom ¶
func (m *SignaturesMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads SignaturesMessage from binary form
func (*SignaturesMessage) UnmarshalBinary ¶
func (m *SignaturesMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes SignaturesMessage from binary form
type SponsorshipV1 ¶
type SponsorshipV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` AssetID crypto.Digest `json:"assetId"` MinAssetFee uint64 `json:"minSponsoredAssetFee"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
SponsorshipV1 is a transaction to setup fee sponsorship for an asset.
func NewUnsignedSponsorshipV1 ¶
func NewUnsignedSponsorshipV1(senderPK crypto.PublicKey, assetID crypto.Digest, minAssetFee, fee, timestamp uint64) (*SponsorshipV1, error)
NewUnsignedSponsorshipV1 creates new unsigned SponsorshipV1 transaction
func (*SponsorshipV1) MarshalBinary ¶
func (tx *SponsorshipV1) MarshalBinary() ([]byte, error)
MarshalBinary writes SponsorshipV1 transaction to its bytes representation.
func (*SponsorshipV1) Sign ¶
func (tx *SponsorshipV1) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*SponsorshipV1) UnmarshalBinary ¶
func (tx *SponsorshipV1) UnmarshalBinary(data []byte) error
UnmarshalBinary reads SponsorshipV1 from its bytes representation.
type StringDataEntry ¶
StringDataEntry structure is a key-value pair to store a string value.
func (StringDataEntry) GetKey ¶
func (e StringDataEntry) GetKey() string
GetKey returns the key of key-value pair.
func (StringDataEntry) GetValueType ¶
func (e StringDataEntry) GetValueType() ValueType
GetValueType returns the type of value in key-value entry.
func (StringDataEntry) MarshalBinary ¶
func (e StringDataEntry) MarshalBinary() ([]byte, error)
MarshalBinary converts the data entry to its byte representation.
func (StringDataEntry) MarshalJSON ¶
func (e StringDataEntry) MarshalJSON() ([]byte, error)
MarshalJSON writes the entry to its JSON representation.
func (*StringDataEntry) UnmarshalBinary ¶
func (e *StringDataEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary reads an StringDataEntry structure from bytes.
func (*StringDataEntry) UnmarshalJSON ¶
func (e *StringDataEntry) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from JSON.
type TransactionMessage ¶
type TransactionMessage struct {
Transaction []byte
}
TransactionMessage represents Transaction message
func (*TransactionMessage) MarshalBinary ¶
func (m *TransactionMessage) MarshalBinary() ([]byte, error)
MarshalBinary encodes TransactionMessage to binary form
func (*TransactionMessage) ReadFrom ¶
func (m *TransactionMessage) ReadFrom(r io.Reader) (int64, error)
ReadFrom reads TransactionMessage from io.Reader
func (*TransactionMessage) UnmarshalBinary ¶
func (m *TransactionMessage) UnmarshalBinary(data []byte) error
UnmarshalBinary decodes TransactionMessage from binary form
type TransactionType ¶
type TransactionType byte
const ( GenesisTransaction TransactionType = iota + 1 PaymentTransaction IssueTransaction TransferTransaction ReissueTransaction BurnTransaction ExchangeTransaction LeaseTransaction LeaseCancelTransaction CreateAliasTransaction MassTransferTransaction DataTransaction SetScriptTransaction SponsorshipTransaction )
type TransferV1 ¶
type TransferV1 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` SenderPK crypto.PublicKey `json:"senderPublicKey"` AmountAsset OptionalAsset `json:"assetId"` FeeAsset OptionalAsset `json:"feeAssetId"` Timestamp uint64 `json:"timestamp,omitempty"` Amount uint64 `json:"amount"` Fee uint64 `json:"fee"` Recipient Address `json:"recipient"` Attachment Attachment `json:"attachment,omitempty"` }
func NewUnsignedTransferV1 ¶
func NewUnsignedTransferV1(senderPK crypto.PublicKey, amountAsset, feeAsset OptionalAsset, timestamp, amount, fee uint64, recipient Address, attachment string) (*TransferV1, error)
func (*TransferV1) MarshalBinary ¶
func (tx *TransferV1) MarshalBinary() ([]byte, error)
func (*TransferV1) UnmarshalBinary ¶
func (tx *TransferV1) UnmarshalBinary(data []byte) error