Documentation ¶
Index ¶
- Constants
- Variables
- func AppendHeaderBytesToTransactions(headerBytes []byte, transactions []byte) ([]byte, error)
- func BlockEncodeJson(b *Block) ([]byte, error)
- func BlockGetParent(data []byte) (crypto.Signature, error)
- func BlockGetSignature(data []byte) (crypto.Signature, error)
- func Bool(buf []byte) (bool, error)
- func BytesWithUInt16Len(buf []byte) ([]byte, error)
- func BytesWithUInt32Len(buf []byte) ([]byte, error)
- func NetworkSchemeByType(networkType string) (byte, error)
- func NetworkStrByType(networkType string) (string, error)
- func NewTimestampFromTime(t time.Time) uint64
- func NewTimestampFromUnixNano(nano int64) uint64
- func PutBool(buf []byte, b bool)
- func PutBytesWithUInt16Len(buf []byte, data []byte)
- func PutBytesWithUInt32Len(buf []byte, data []byte)
- func PutStringWithUInt16Len(buf []byte, s string)
- func PutStringWithUInt32Len(buf []byte, s string)
- func PutStringWithUInt8Len(buf []byte, s string)
- func ReadPacket(buf []byte, r io.Reader) (int64, error)
- func ReadPayload(buf []byte, r io.Reader) (int64, error)
- func StringWithUInt16Len(buf []byte) (string, error)
- func StringWithUInt32Len(buf []byte) (string, error)
- func StringWithUInt8Len(buf []byte) (string, error)
- type Address
- func MustAddressFromPublicKey(scheme byte, publicKey crypto.PublicKey) Address
- func NewAddressFromBytes(b []byte) (Address, error)
- func NewAddressFromPublicKey(scheme byte, publicKey crypto.PublicKey) (Address, error)
- func NewAddressFromString(s string) (Address, error)
- func NewAddressLikeFromAnyBytes(scheme byte, b []byte) (Address, error)
- func RebuildAddress(scheme byte, body []byte) (Address, error)
- type Alias
- func (a *Alias) Bytes() []byte
- func (a *Alias) MarshalBinary() ([]byte, error)
- func (a Alias) MarshalJSON() ([]byte, error)
- func (a *Alias) Serialize(s *serializer.Serializer) error
- func (a Alias) String() string
- func (a *Alias) UnmarshalBinary(data []byte) error
- func (a *Alias) UnmarshalJSON(value []byte) error
- func (a Alias) Valid() (bool, error)
- func (a *Alias) WriteTo(w io.Writer) (int64, error)
- type Argument
- type ArgumentType
- type ArgumentValueType
- type Arguments
- type AssetInfo
- type AssetPair
- type Attachment
- type B58Bytes
- type BinaryArgument
- func (a BinaryArgument) GetValueType() ArgumentValueType
- func (a BinaryArgument) MarshalBinary() ([]byte, error)
- func (a BinaryArgument) MarshalJSON() ([]byte, error)
- func (a BinaryArgument) Serialize(s *serializer.Serializer) error
- func (a *BinaryArgument) UnmarshalBinary(data []byte) error
- func (a *BinaryArgument) UnmarshalJSON(value []byte) error
- type BinaryDataEntry
- func (e BinaryDataEntry) GetKey() string
- func (e BinaryDataEntry) GetValueType() DataValueType
- func (e BinaryDataEntry) MarshalBinary() ([]byte, error)
- func (e BinaryDataEntry) MarshalJSON() ([]byte, error)
- func (e BinaryDataEntry) MarshalValue() ([]byte, error)
- func (e *BinaryDataEntry) SetKey(key string)
- func (e *BinaryDataEntry) UnmarshalBinary(data []byte) error
- func (e *BinaryDataEntry) UnmarshalJSON(value []byte) error
- func (e *BinaryDataEntry) UnmarshalValue(data []byte) error
- func (e BinaryDataEntry) Valid() (bool, error)
- type Block
- func (b *Block) MarshalBinary() ([]byte, error)
- func (b *Block) Sign(secret crypto.SecretKey) error
- func (b *Block) UnmarshalBinary(data []byte) (err error)
- func (b *Block) VerifySignature() (bool, error)
- func (b *Block) WriteTo(w io.Writer) (int64, error)
- func (b *Block) WriteToWithoutSignature(w io.Writer) (int64, error)
- type BlockHeader
- type BlockInfo
- type BlockMessage
- type BlockVersion
- type BooleanArgument
- func (a BooleanArgument) GetValueType() ArgumentValueType
- func (a BooleanArgument) MarshalBinary() ([]byte, error)
- func (a BooleanArgument) MarshalJSON() ([]byte, error)
- func (a BooleanArgument) Serialize(s *serializer.Serializer) error
- func (a *BooleanArgument) UnmarshalBinary(data []byte) error
- func (a *BooleanArgument) UnmarshalJSON(value []byte) error
- type BooleanDataEntry
- func (e BooleanDataEntry) GetKey() string
- func (e BooleanDataEntry) GetValueType() DataValueType
- func (e BooleanDataEntry) MarshalBinary() ([]byte, error)
- func (e BooleanDataEntry) MarshalJSON() ([]byte, error)
- func (e BooleanDataEntry) MarshalValue() ([]byte, error)
- func (e *BooleanDataEntry) SetKey(key string)
- func (e *BooleanDataEntry) UnmarshalBinary(data []byte) error
- func (e *BooleanDataEntry) UnmarshalJSON(value []byte) error
- func (e *BooleanDataEntry) UnmarshalValue(data []byte) error
- func (e BooleanDataEntry) Valid() (bool, error)
- type BulkMessage
- type Burn
- type BurnV1
- func (tx *BurnV1) BodyMarshalBinary() ([]byte, error)
- func (tx *BurnV1) Clone() *BurnV1
- func (tx *BurnV1) GenerateID()
- func (tx BurnV1) GetID() ([]byte, error)
- func (tx BurnV1) GetTypeVersion() TransactionTypeVersion
- func (tx *BurnV1) MarshalBinary() ([]byte, error)
- func (tx *BurnV1) Sign(secretKey crypto.SecretKey) error
- func (tx *BurnV1) UnmarshalBinary(data []byte) error
- func (tx *BurnV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type BurnV2
- func (tx *BurnV2) BodyMarshalBinary() ([]byte, error)
- func (tx *BurnV2) Clone() *BurnV2
- func (tx *BurnV2) GenerateID()
- func (tx BurnV2) GetID() ([]byte, error)
- func (tx BurnV2) GetTypeVersion() TransactionTypeVersion
- func (tx *BurnV2) MarshalBinary() ([]byte, error)
- func (tx *BurnV2) Sign(secretKey crypto.SecretKey) error
- func (tx *BurnV2) UnmarshalBinary(data []byte) error
- func (tx BurnV2) Valid() (bool, error)
- func (tx *BurnV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type ByVersion
- type Bytes
- type CheckPointMessage
- type CheckpointItem
- type CreateAlias
- type CreateAliasV1
- func (tx *CreateAliasV1) BodyMarshalBinary() ([]byte, error)
- func (tx *CreateAliasV1) Clone() *CreateAliasV1
- func (tx *CreateAliasV1) GenerateID()
- func (tx CreateAliasV1) GetID() ([]byte, error)
- func (tx CreateAliasV1) GetTypeVersion() TransactionTypeVersion
- func (tx *CreateAliasV1) MarshalBinary() ([]byte, error)
- func (tx *CreateAliasV1) Sign(secretKey crypto.SecretKey) error
- func (tx *CreateAliasV1) UnmarshalBinary(data []byte) error
- func (tx *CreateAliasV1) UnmarshalJSON(data []byte) error
- func (tx *CreateAliasV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type CreateAliasV2
- func (tx *CreateAliasV2) BodyMarshalBinary() ([]byte, error)
- func (tx *CreateAliasV2) Clone() *CreateAliasV2
- func (tx *CreateAliasV2) GenerateID()
- func (tx CreateAliasV2) GetID() ([]byte, error)
- func (tx CreateAliasV2) GetTypeVersion() TransactionTypeVersion
- func (tx *CreateAliasV2) MarshalBinary() ([]byte, error)
- func (tx *CreateAliasV2) Sign(secretKey crypto.SecretKey) error
- func (tx *CreateAliasV2) UnmarshalBinary(data []byte) error
- func (tx *CreateAliasV2) UnmarshalJSON(data []byte) error
- func (tx *CreateAliasV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type DataEntries
- type DataEntry
- type DataEntryType
- type DataV1
- func (tx *DataV1) AppendEntry(entry DataEntry) error
- func (tx *DataV1) BodyMarshalBinary() ([]byte, error)
- func (tx *DataV1) Clone() *DataV1
- func (tx *DataV1) GenerateID()
- func (tx DataV1) GetFee() uint64
- func (tx DataV1) GetID() ([]byte, error)
- func (tx DataV1) GetSenderPK() crypto.PublicKey
- func (tx DataV1) GetTimestamp() uint64
- func (tx DataV1) GetTypeVersion() TransactionTypeVersion
- func (tx *DataV1) MarshalBinary() ([]byte, error)
- func (tx *DataV1) Sign(secretKey crypto.SecretKey) error
- func (tx *DataV1) UnmarshalBinary(data []byte) error
- func (tx DataV1) Valid() (bool, error)
- func (tx *DataV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type DataValueType
- type Exchange
- type ExchangeV1
- func (tx *ExchangeV1) BodyMarshalBinary() ([]byte, error)
- func (tx *ExchangeV1) BodySerialize(s *serializer.Serializer) error
- func (tx *ExchangeV1) Clone() *ExchangeV1
- func (tx *ExchangeV1) GenerateID()
- func (tx ExchangeV1) GetAmount() uint64
- func (tx ExchangeV1) GetBuyMatcherFee() uint64
- func (tx ExchangeV1) GetBuyOrder() (OrderBody, error)
- func (tx ExchangeV1) GetBuyOrderFull() Order
- func (tx ExchangeV1) GetFee() uint64
- func (tx ExchangeV1) GetID() ([]byte, error)
- func (tx ExchangeV1) GetPrice() uint64
- func (tx ExchangeV1) GetSellMatcherFee() uint64
- func (tx ExchangeV1) GetSellOrder() (OrderBody, error)
- func (tx ExchangeV1) GetSellOrderFull() Order
- func (tx ExchangeV1) GetSenderPK() crypto.PublicKey
- func (tx ExchangeV1) GetTimestamp() uint64
- func (tx ExchangeV1) GetTypeVersion() TransactionTypeVersion
- func (tx *ExchangeV1) MarshalBinary() ([]byte, error)
- func (tx *ExchangeV1) Sign(secretKey crypto.SecretKey) error
- func (tx *ExchangeV1) UnmarshalBinary(data []byte) error
- func (tx ExchangeV1) Valid() (bool, error)
- func (tx *ExchangeV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type ExchangeV2
- func (tx *ExchangeV2) BodyMarshalBinary() ([]byte, error)
- func (tx *ExchangeV2) Clone() *ExchangeV2
- func (tx *ExchangeV2) GenerateID()
- func (tx ExchangeV2) GetAmount() uint64
- func (tx ExchangeV2) GetBuyMatcherFee() uint64
- func (tx ExchangeV2) GetBuyOrder() (OrderBody, error)
- func (tx ExchangeV2) GetBuyOrderFull() Order
- func (tx ExchangeV2) GetFee() uint64
- func (tx ExchangeV2) GetID() ([]byte, error)
- func (tx ExchangeV2) GetPrice() uint64
- func (tx ExchangeV2) GetSellMatcherFee() uint64
- func (tx ExchangeV2) GetSellOrder() (OrderBody, error)
- func (tx ExchangeV2) GetSellOrderFull() Order
- func (tx ExchangeV2) GetSenderPK() crypto.PublicKey
- func (tx ExchangeV2) GetTimestamp() uint64
- func (tx ExchangeV2) GetTypeVersion() TransactionTypeVersion
- func (tx *ExchangeV2) MarshalBinary() ([]byte, error)
- func (tx *ExchangeV2) Sign(secretKey crypto.SecretKey) error
- func (tx *ExchangeV2) UnmarshalBinary(data []byte) error
- func (tx *ExchangeV2) UnmarshalJSON(data []byte) error
- func (tx ExchangeV2) Valid() (bool, error)
- func (tx *ExchangeV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type FullScriptTransfer
- type FunctionCall
- type Genesis
- func (tx *Genesis) GenerateID()
- func (tx *Genesis) GenerateSigID() error
- func (tx Genesis) GetFee() uint64
- func (tx Genesis) GetID() ([]byte, error)
- func (tx Genesis) GetSenderPK() crypto.PublicKey
- func (tx Genesis) GetTimestamp() uint64
- func (tx Genesis) GetTypeVersion() TransactionTypeVersion
- func (tx *Genesis) MarshalBinary() ([]byte, error)
- func (tx *Genesis) UnmarshalBinary(data []byte) error
- func (tx Genesis) Valid() (bool, error)
- type GetBlockMessage
- type GetPeersMessage
- type GetSignaturesMessage
- type Handshake
- type HandshakeTCPAddr
- type Header
- type Height
- type IntegerArgument
- func (a IntegerArgument) GetValueType() ArgumentValueType
- func (a IntegerArgument) MarshalBinary() ([]byte, error)
- func (a IntegerArgument) MarshalJSON() ([]byte, error)
- func (a IntegerArgument) Serialize(s *serializer.Serializer) error
- func (a *IntegerArgument) UnmarshalBinary(data []byte) error
- func (a *IntegerArgument) UnmarshalJSON(value []byte) error
- type IntegerDataEntry
- func (e IntegerDataEntry) GetKey() string
- func (e IntegerDataEntry) GetValueType() DataValueType
- func (e IntegerDataEntry) MarshalBinary() ([]byte, error)
- func (e IntegerDataEntry) MarshalJSON() ([]byte, error)
- func (e IntegerDataEntry) MarshalValue() ([]byte, error)
- func (e *IntegerDataEntry) SetKey(key string)
- func (e *IntegerDataEntry) UnmarshalBinary(data []byte) error
- func (e *IntegerDataEntry) UnmarshalJSON(value []byte) error
- func (e *IntegerDataEntry) UnmarshalValue(data []byte) error
- func (e IntegerDataEntry) Valid() (bool, error)
- type InvokeScriptV1
- func (tx *InvokeScriptV1) BodyMarshalBinary() ([]byte, error)
- func (tx *InvokeScriptV1) BodySerialize(s *serializer.Serializer) error
- func (tx *InvokeScriptV1) Clone() *InvokeScriptV1
- func (tx *InvokeScriptV1) GenerateID()
- func (tx InvokeScriptV1) GetFee() uint64
- func (tx InvokeScriptV1) GetID() ([]byte, error)
- func (tx InvokeScriptV1) GetSenderPK() crypto.PublicKey
- func (tx InvokeScriptV1) GetTimestamp() uint64
- func (tx InvokeScriptV1) GetTypeVersion() TransactionTypeVersion
- func (tx *InvokeScriptV1) MarshalBinary() ([]byte, error)
- func (tx *InvokeScriptV1) Serialize(s *serializer.Serializer) error
- func (tx *InvokeScriptV1) Sign(secretKey crypto.SecretKey) error
- func (tx *InvokeScriptV1) UnmarshalBinary(data []byte) error
- func (tx InvokeScriptV1) Valid() (bool, error)
- func (tx *InvokeScriptV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type IpPort
- type Issue
- type IssueV1
- func (tx *IssueV1) BodyMarshalBinary() ([]byte, error)
- func (tx *IssueV1) Clone() *IssueV1
- func (tx *IssueV1) GenerateID()
- func (tx IssueV1) GetID() ([]byte, error)
- func (tx IssueV1) GetTypeVersion() TransactionTypeVersion
- func (tx *IssueV1) MarshalBinary() ([]byte, error)
- func (tx *IssueV1) Sign(secretKey crypto.SecretKey) error
- func (tx *IssueV1) UnmarshalBinary(data []byte) error
- func (tx *IssueV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type IssueV2
- func (tx *IssueV2) BodyMarshalBinary() ([]byte, error)
- func (tx *IssueV2) Clone() *IssueV2
- func (tx *IssueV2) GenerateID()
- func (tx IssueV2) GetID() ([]byte, error)
- func (tx IssueV2) GetTypeVersion() TransactionTypeVersion
- func (tx *IssueV2) MarshalBinary() ([]byte, error)
- func (tx *IssueV2) NonEmptyScript() bool
- func (tx *IssueV2) Sign(secretKey crypto.SecretKey) error
- func (tx *IssueV2) UnmarshalBinary(data []byte) error
- func (tx IssueV2) Valid() (bool, error)
- func (tx *IssueV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type KeyPair
- type Lease
- type LeaseCancel
- type LeaseCancelV1
- func (tx *LeaseCancelV1) BodyMarshalBinary() ([]byte, error)
- func (tx *LeaseCancelV1) Clone() *LeaseCancelV1
- func (tx *LeaseCancelV1) GenerateID()
- func (tx LeaseCancelV1) GetID() ([]byte, error)
- func (tx LeaseCancelV1) GetTypeVersion() TransactionTypeVersion
- func (tx *LeaseCancelV1) MarshalBinary() ([]byte, error)
- func (tx *LeaseCancelV1) Sign(secretKey crypto.SecretKey) error
- func (tx *LeaseCancelV1) UnmarshalBinary(data []byte) error
- func (tx *LeaseCancelV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type LeaseCancelV2
- func (tx *LeaseCancelV2) BodyMarshalBinary() ([]byte, error)
- func (tx *LeaseCancelV2) Clone() *LeaseCancelV2
- func (tx *LeaseCancelV2) GenerateID()
- func (tx LeaseCancelV2) GetID() ([]byte, error)
- func (tx LeaseCancelV2) GetTypeVersion() TransactionTypeVersion
- func (tx *LeaseCancelV2) MarshalBinary() ([]byte, error)
- func (tx *LeaseCancelV2) Sign(secretKey crypto.SecretKey) error
- func (tx *LeaseCancelV2) UnmarshalBinary(data []byte) error
- func (tx LeaseCancelV2) Valid() (bool, error)
- func (tx *LeaseCancelV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type LeaseV1
- func (tx *LeaseV1) BodyMarshalBinary() ([]byte, error)
- func (tx *LeaseV1) Clone() *LeaseV1
- func (tx *LeaseV1) GenerateID()
- func (tx LeaseV1) GetID() ([]byte, error)
- func (tx LeaseV1) GetTypeVersion() TransactionTypeVersion
- func (tx *LeaseV1) MarshalBinary() ([]byte, error)
- func (tx *LeaseV1) Sign(secretKey crypto.SecretKey) error
- func (tx *LeaseV1) UnmarshalBinary(data []byte) error
- func (tx *LeaseV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type LeaseV2
- func (tx *LeaseV2) BodyMarshalBinary() ([]byte, error)
- func (tx *LeaseV2) Clone() *LeaseV2
- func (tx *LeaseV2) GenerateID()
- func (tx LeaseV2) GetID() ([]byte, error)
- func (tx LeaseV2) GetTypeVersion() TransactionTypeVersion
- func (tx *LeaseV2) MarshalBinary() ([]byte, error)
- func (tx *LeaseV2) Sign(secretKey crypto.SecretKey) error
- func (tx *LeaseV2) UnmarshalBinary(data []byte) error
- func (tx *LeaseV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type MassTransferEntry
- type MassTransferV1
- func (tx *MassTransferV1) BodyMarshalBinary() ([]byte, error)
- func (tx *MassTransferV1) Clone() *MassTransferV1
- func (tx *MassTransferV1) GenerateID()
- func (tx MassTransferV1) GetFee() uint64
- func (tx MassTransferV1) GetID() ([]byte, error)
- func (tx MassTransferV1) GetSenderPK() crypto.PublicKey
- func (tx MassTransferV1) GetTimestamp() uint64
- func (tx MassTransferV1) GetTypeVersion() TransactionTypeVersion
- func (tx *MassTransferV1) MarshalBinary() ([]byte, error)
- func (tx *MassTransferV1) Sign(secretKey crypto.SecretKey) error
- func (tx *MassTransferV1) UnmarshalBinary(data []byte) error
- func (tx MassTransferV1) Valid() (bool, error)
- func (tx *MassTransferV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type Message
- type MicroBlock
- type MicroBlockInv
- func (a *MicroBlockInv) MarshalBinary() ([]byte, error)
- func (a *MicroBlockInv) Sign(key crypto.SecretKey, schema Scheme) error
- func (a *MicroBlockInv) UnmarshalBinary(data []byte) error
- func (a *MicroBlockInv) Verify(schema Scheme) (bool, error)
- func (a *MicroBlockInv) WriteTo(w io.Writer) (int64, error)
- type MicroBlockInvMessage
- type MicroBlockMessage
- type MicroBlockRequest
- type MicroBlockRequestMessage
- type MicroblockTotalSig
- type NxtConsensus
- type OptionalAsset
- func (a OptionalAsset) MarshalBinary() ([]byte, error)
- func (a OptionalAsset) MarshalJSON() ([]byte, error)
- func (a OptionalAsset) Serialize(s *serializer.Serializer) error
- func (a OptionalAsset) String() string
- func (a *OptionalAsset) ToID() []byte
- func (a *OptionalAsset) UnmarshalBinary(data []byte) error
- func (a *OptionalAsset) UnmarshalJSON(value []byte) error
- func (a OptionalAsset) WriteTo(w io.Writer) (int64, error)
- type Order
- type OrderBody
- func (o OrderBody) GetSenderPK() crypto.PublicKey
- func (o *OrderBody) ReceiveAmount(matchAmount, matchPrice uint64) (uint64, error)
- func (o *OrderBody) Serialize(s *serializer.Serializer) error
- func (o *OrderBody) SpendAmount(matchAmount, matchPrice uint64) (uint64, error)
- func (o *OrderBody) SpendAsset() OptionalAsset
- func (o OrderBody) Valid() (bool, error)
- type OrderType
- type OrderV1
- func (o OrderV1) BodyMarshalBinary() ([]byte, error)
- func (o OrderV1) BodySerialize(s *serializer.Serializer) error
- func (o OrderV1) GetAmount() uint64
- func (o *OrderV1) GetAssetPair() AssetPair
- func (o *OrderV1) GetExpiration() uint64
- func (o OrderV1) GetID() ([]byte, error)
- func (o OrderV1) GetMatcherFee() uint64
- func (o OrderV1) GetMatcherFeeAsset() OptionalAsset
- func (o *OrderV1) GetMatcherPK() crypto.PublicKey
- func (o *OrderV1) GetOrderType() OrderType
- func (o *OrderV1) GetPrice() uint64
- func (o OrderV1) GetProofs() (*ProofsV1, error)
- func (o OrderV1) GetTimestamp() uint64
- func (o *OrderV1) GetVersion() byte
- func (o *OrderV1) MarshalBinary() ([]byte, error)
- func (o *OrderV1) Serialize(s *serializer.Serializer) error
- func (o *OrderV1) Sign(secretKey crypto.SecretKey) error
- func (o *OrderV1) UnmarshalBinary(data []byte) error
- func (o *OrderV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type OrderV2
- func (o OrderV2) BodyMarshalBinary() ([]byte, error)
- func (o OrderV2) GetAmount() uint64
- func (o *OrderV2) GetAssetPair() AssetPair
- func (o *OrderV2) GetExpiration() uint64
- func (o OrderV2) GetID() ([]byte, error)
- func (o OrderV2) GetMatcherFee() uint64
- func (o OrderV2) GetMatcherFeeAsset() OptionalAsset
- func (o *OrderV2) GetMatcherPK() crypto.PublicKey
- func (o *OrderV2) GetOrderType() OrderType
- func (o *OrderV2) GetPrice() uint64
- func (o OrderV2) GetProofs() (*ProofsV1, error)
- func (o OrderV2) GetTimestamp() uint64
- func (o *OrderV2) GetVersion() byte
- func (o *OrderV2) MarshalBinary() ([]byte, error)
- func (o *OrderV2) Sign(secretKey crypto.SecretKey) error
- func (o *OrderV2) UnmarshalBinary(data []byte) error
- func (o *OrderV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type OrderV3
- func (o *OrderV3) BodyMarshalBinary() ([]byte, error)
- func (o OrderV3) GetAmount() uint64
- func (o *OrderV3) GetAssetPair() AssetPair
- func (o *OrderV3) GetExpiration() uint64
- func (o *OrderV3) GetID() ([]byte, error)
- func (o OrderV3) GetMatcherFee() uint64
- func (o OrderV3) GetMatcherFeeAsset() OptionalAsset
- func (o *OrderV3) GetMatcherPK() crypto.PublicKey
- func (o *OrderV3) GetOrderType() OrderType
- func (o *OrderV3) GetPrice() uint64
- func (o OrderV3) GetProofs() (*ProofsV1, error)
- func (o OrderV3) GetTimestamp() uint64
- func (o *OrderV3) GetVersion() byte
- func (o *OrderV3) MarshalBinary() ([]byte, error)
- func (o *OrderV3) Sign(secretKey crypto.SecretKey) error
- func (o *OrderV3) UnmarshalBinary(data []byte) error
- func (o *OrderV3) Verify(publicKey crypto.PublicKey) (bool, error)
- type OrderVersion
- type Payment
- func (tx *Payment) BodyMarshalBinary() ([]byte, error)
- func (tx *Payment) GenerateID()
- func (tx Payment) GetFee() uint64
- func (tx Payment) GetID() ([]byte, error)
- func (tx Payment) GetSenderPK() crypto.PublicKey
- func (tx Payment) GetTimestamp() uint64
- func (tx Payment) GetTypeVersion() TransactionTypeVersion
- func (tx *Payment) MarshalBinary() ([]byte, error)
- func (tx *Payment) MarshalBinary2(buf []byte) ([]byte, error)
- func (tx *Payment) Sign(secretKey crypto.SecretKey) error
- func (tx *Payment) UnmarshalBinary(data []byte) error
- func (tx Payment) Valid() (bool, error)
- func (tx *Payment) Verify(publicKey crypto.PublicKey) (bool, error)
- type PeerInfo
- func (m *PeerInfo) Empty() bool
- func (m *PeerInfo) MarshalBinary() ([]byte, error)
- func (m PeerInfo) MarshalJSON() ([]byte, error)
- func (a *PeerInfo) ReadFrom(r io.Reader) (int64, error)
- func (m PeerInfo) String() string
- func (m *PeerInfo) UnmarshalBinary(data []byte) error
- func (m *PeerInfo) UnmarshalJSON(value []byte) error
- func (a PeerInfo) WriteTo(w io.Writer) (int64, error)
- type PeersMessage
- type ProofsV1
- func (p *ProofsV1) MarshalBinary() ([]byte, error)
- func (p ProofsV1) MarshalJSON() ([]byte, error)
- func (p *ProofsV1) Serialize(s *serializer.Serializer) 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 Recipient
- func (r *Recipient) MarshalBinary() ([]byte, error)
- func (r Recipient) MarshalJSON() ([]byte, error)
- func (r *Recipient) Serialize(s *serializer.Serializer) error
- func (r *Recipient) String() string
- func (r *Recipient) UnmarshalBinary(data []byte) error
- func (r *Recipient) UnmarshalJSON(value []byte) error
- func (r Recipient) Valid() (bool, error)
- func (r *Recipient) WriteTo(w io.Writer) (int64, error)
- type Reissue
- type ReissueV1
- func (tx *ReissueV1) BodyMarshalBinary() ([]byte, error)
- func (tx *ReissueV1) Clone() *ReissueV1
- func (tx *ReissueV1) GenerateID()
- func (tx ReissueV1) GetID() ([]byte, error)
- func (tx ReissueV1) GetTypeVersion() TransactionTypeVersion
- func (tx *ReissueV1) MarshalBinary() ([]byte, error)
- func (tx *ReissueV1) Sign(secretKey crypto.SecretKey) error
- func (tx *ReissueV1) UnmarshalBinary(data []byte) error
- func (tx *ReissueV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type ReissueV2
- func (tx *ReissueV2) BodyMarshalBinary() ([]byte, error)
- func (tx *ReissueV2) Clone() *ReissueV2
- func (tx *ReissueV2) GenerateID()
- func (tx ReissueV2) GetID() ([]byte, error)
- func (tx ReissueV2) GetTypeVersion() TransactionTypeVersion
- func (tx *ReissueV2) MarshalBinary() ([]byte, error)
- func (tx *ReissueV2) Sign(secretKey crypto.SecretKey) error
- func (tx *ReissueV2) UnmarshalBinary(data []byte) error
- func (tx ReissueV2) Valid() (bool, error)
- func (tx *ReissueV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type Scheme
- type Score
- type ScoreMessage
- type Script
- type ScriptPayment
- type ScriptPayments
- type ScriptResult
- type ScriptResultTransfer
- type SetAssetScriptV1
- func (tx *SetAssetScriptV1) BodyMarshalBinary() ([]byte, error)
- func (tx *SetAssetScriptV1) Clone() *SetAssetScriptV1
- func (tx *SetAssetScriptV1) GenerateID()
- func (tx SetAssetScriptV1) GetFee() uint64
- func (tx SetAssetScriptV1) GetID() ([]byte, error)
- func (tx SetAssetScriptV1) GetSenderPK() crypto.PublicKey
- func (tx SetAssetScriptV1) GetTimestamp() uint64
- func (tx SetAssetScriptV1) GetTypeVersion() TransactionTypeVersion
- func (tx *SetAssetScriptV1) MarshalBinary() ([]byte, error)
- func (tx *SetAssetScriptV1) NonEmptyScript() bool
- func (tx *SetAssetScriptV1) Sign(secretKey crypto.SecretKey) error
- func (tx *SetAssetScriptV1) UnmarshalBinary(data []byte) error
- func (tx SetAssetScriptV1) Valid() (bool, error)
- func (tx *SetAssetScriptV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type SetScriptV1
- func (tx *SetScriptV1) BodyMarshalBinary() ([]byte, error)
- func (tx *SetScriptV1) GenerateID()
- func (tx SetScriptV1) GetFee() uint64
- func (tx SetScriptV1) GetID() ([]byte, error)
- func (tx SetScriptV1) GetSenderPK() crypto.PublicKey
- func (tx SetScriptV1) GetTimestamp() uint64
- func (tx SetScriptV1) GetTypeVersion() TransactionTypeVersion
- func (tx *SetScriptV1) MarshalBinary() ([]byte, error)
- func (tx *SetScriptV1) NonEmptyScript() bool
- func (tx *SetScriptV1) Sign(secretKey crypto.SecretKey) error
- func (tx *SetScriptV1) UnmarshalBinary(data []byte) error
- func (tx SetScriptV1) Valid() (bool, error)
- func (tx *SetScriptV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type SignaturesMessage
- type SponsorshipV1
- func (tx *SponsorshipV1) BodyMarshalBinary() ([]byte, error)
- func (tx *SponsorshipV1) Clone() *SponsorshipV1
- func (tx *SponsorshipV1) GenerateID()
- func (tx SponsorshipV1) GetFee() uint64
- func (tx SponsorshipV1) GetID() ([]byte, error)
- func (tx SponsorshipV1) GetSenderPK() crypto.PublicKey
- func (tx SponsorshipV1) GetTimestamp() uint64
- func (tx SponsorshipV1) GetTypeVersion() TransactionTypeVersion
- func (tx *SponsorshipV1) MarshalBinary() ([]byte, error)
- func (tx *SponsorshipV1) Sign(secretKey crypto.SecretKey) error
- func (tx *SponsorshipV1) UnmarshalBinary(data []byte) error
- func (tx SponsorshipV1) Valid() (bool, error)
- func (tx *SponsorshipV1) Verify(publicKey crypto.PublicKey) (bool, error)
- type StringArgument
- func (a StringArgument) GetValueType() ArgumentValueType
- func (a StringArgument) MarshalBinary() ([]byte, error)
- func (a StringArgument) MarshalJSON() ([]byte, error)
- func (a StringArgument) Serialize(s *serializer.Serializer) error
- func (a *StringArgument) UnmarshalBinary(data []byte) error
- func (a *StringArgument) UnmarshalJSON(value []byte) error
- type StringDataEntry
- func (e StringDataEntry) GetKey() string
- func (e StringDataEntry) GetValueType() DataValueType
- func (e StringDataEntry) MarshalBinary() ([]byte, error)
- func (e StringDataEntry) MarshalJSON() ([]byte, error)
- func (e StringDataEntry) MarshalValue() ([]byte, error)
- func (e *StringDataEntry) SetKey(key string)
- func (e *StringDataEntry) UnmarshalBinary(data []byte) error
- func (e *StringDataEntry) UnmarshalJSON(value []byte) error
- func (e *StringDataEntry) UnmarshalValue(data []byte) error
- func (e StringDataEntry) Valid() (bool, error)
- type TCPAddr
- type Timestamp
- type Transaction
- type TransactionMessage
- type TransactionType
- type TransactionTypeVersion
- type Transactions
- type TransactionsRepresentation
- func (a *TransactionsRepresentation) Bytes() ([]byte, error)
- func (a *TransactionsRepresentation) BytesUnchecked() []byte
- func (a *TransactionsRepresentation) Count() int
- func (a TransactionsRepresentation) Join(other *TransactionsRepresentation) (*TransactionsRepresentation, error)
- func (a TransactionsRepresentation) MarshalJSON() ([]byte, error)
- func (a *TransactionsRepresentation) Transactions() (Transactions, error)
- func (a *TransactionsRepresentation) UnmarshalJSON(data []byte) error
- type Transfer
- type TransferSet
- type TransferV1
- func (tx *TransferV1) BodyMarshalBinary() ([]byte, error)
- func (tx *TransferV1) BodySerialize(s *serializer.Serializer) error
- func (tx *TransferV1) Clone() *TransferV1
- func (tx *TransferV1) GenerateID()
- func (tx TransferV1) GetID() ([]byte, error)
- func (tx TransferV1) GetTypeVersion() TransactionTypeVersion
- func (tx *TransferV1) MarshalBinary() ([]byte, error)
- func (tx *TransferV1) Serialize(s *serializer.Serializer) error
- func (tx *TransferV1) Sign(secretKey crypto.SecretKey) error
- func (tx *TransferV1) UnmarshalBinary(data []byte) error
- func (tx *TransferV1) Verify(publicKey crypto.PublicKey) (bool, error)
- func (tx *TransferV1) WriteTo(w io.Writer) (int64, error)
- type TransferV2
- func (tx *TransferV2) BodyMarshalBinary() ([]byte, error)
- func (tx *TransferV2) BodySerialize(s *serializer.Serializer) error
- func (tx *TransferV2) BodyUnmarshalBinary(data []byte) error
- func (tx *TransferV2) Clone() *TransferV2
- func (tx *TransferV2) GenerateID()
- func (tx TransferV2) GetID() ([]byte, error)
- func (tx TransferV2) GetTypeVersion() TransactionTypeVersion
- func (tx *TransferV2) MarshalBinary() ([]byte, error)
- func (tx *TransferV2) Serialize(s *serializer.Serializer) error
- func (tx *TransferV2) Sign(secretKey crypto.SecretKey) error
- func (tx *TransferV2) UnmarshalBinary(data []byte) error
- func (tx TransferV2) Valid() (bool, error)
- func (tx *TransferV2) Verify(publicKey crypto.PublicKey) (bool, error)
- type U32
- type U64
- type U8String
- type Version
- type WrapWriteTo
- type WriteSet
Constants ¶
const ( AddressSize = headerSize + bodySize + checksumSize AliasMinLength = 4 AliasMaxLength = 30 AliasAlphabet = "-.0123456789@_abcdefghijklmnopqrstuvwxyz" AliasPrefix = "alias" MainNetScheme byte = 'W' TestNetScheme byte = 'T' StageNetScheme byte = 'S' CustomNetScheme byte = 'E' )
const ( MaxHeaderLength = 17 HeaderSizeWithPayload = 17 HeaderSizeWithoutPayload = 13 )
const ( ContentIDGetPeers = 0x1 ContentIDPeers = 0x2 ContentIDGetSignatures = 0x14 ContentIDSignatures = 0x15 ContentIDGetBlock = 0x16 ContentIDBlock = 0x17 ContentIDScore = 0x18 ContentIDTransaction = 0x19 ContentIDInvMicroblock = 0x1A ContentIDCheckpoint = 0x64 ContentIDMicroblockRequest = 27 ContentIDMicroblock = 28 HeaderContentIDPosition = 8 )
Constants for message IDs
const ( //WavesAssetName is the default name for basic WAVES asset. WavesAssetName = "WAVES" PriceConstant = 100000000 MaxOrderAmount = 100 * PriceConstant * PriceConstant MaxOrderTTL = uint64((30 * 24 * time.Hour) / time.Millisecond) )
const ( BooleanTrue = 6 BooleanFalse = 7 )
Special values to represent Boolean value
const IpPortLength = net.IPv6len + 8
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func AppendHeaderBytesToTransactions ¶ added in v0.3.0
func BlockEncodeJson ¶ added in v0.3.0
func BlockGetParent ¶ added in v0.3.0
BlockGetParent get parent signature from block without deserialization
func BlockGetSignature ¶ added in v0.3.0
BlockGetSignature get signature from block without deserialization
func BytesWithUInt16Len ¶
BytesWithUInt16Len reads from buf an array of bytes of length encoded in first 2 bytes.
func BytesWithUInt32Len ¶ added in v0.3.0
BytesWithUInt32Len reads from buf an array of bytes of length encoded in first 4 bytes.
func NetworkSchemeByType ¶ added in v0.3.0
func NetworkStrByType ¶ added in v0.3.0
func NewTimestampFromTime ¶ added in v0.3.0
func NewTimestampFromUnixNano ¶ added in v0.3.0
func PutBytesWithUInt16Len ¶
PutBytesWithUInt16Len prepends given buf with 2 bytes of it's length.
func PutBytesWithUInt32Len ¶ added in v0.3.0
PutBytesWithUInt32Len prepends given buf with 4 bytes of it's length.
func PutStringWithUInt16Len ¶
PutStringWithUInt16Len writes to the buffer `buf` two bytes of the string `s` length followed with the bytes of the string `s`.
func PutStringWithUInt32Len ¶ added in v0.3.0
PutStringWithUInt32Len writes to the buffer `buf` four bytes of the string's `s` length followed with the bytes of string itself.
func PutStringWithUInt8Len ¶ added in v0.3.0
PutStringWithUInt8Len converts the string to slice of bytes. The first byte of resulting slice contains the length of the string.
func StringWithUInt16Len ¶
StringWithUInt16Len reads a string from the buffer `buf`.
func StringWithUInt32Len ¶ added in v0.3.0
StringWithUInt32Len reads a string from the buffer `buf`.
func StringWithUInt8Len ¶ added in v0.3.0
StringWithUInt8Len reads a string from given slice of bytes. The first byte of slice should contain the length of the following string. Function fails then the length of slice is less then 1 byte or the length of remaining slice is less then the length value from first byte.
Types ¶
type Address ¶
type Address [AddressSize]byte
Address is the transformed Public Key with additional bytes of the version, a blockchain scheme and a checksum.
func MustAddressFromPublicKey ¶ added in v0.3.0
func NewAddressFromBytes ¶
NewAddressFromBytes creates an Address from the slice of bytes and checks that the result address is valid address.
func NewAddressFromPublicKey ¶
NewAddressFromPublicKey produces an Address from given scheme and Public Key bytes.
func NewAddressFromString ¶
NewAddressFromString creates an Address from its string representation. This function checks that the address is valid.
func NewAddressLikeFromAnyBytes ¶ added in v0.3.0
NewAddressFromPublicKey produces an Address from given scheme and Public Key bytes.
func RebuildAddress ¶ added in v0.3.0
func (Address) Bytes ¶ added in v0.2.0
Bytes converts the fixed-length byte array of the Address to a slice of bytes.
func (Address) MarshalJSON ¶
MarshalJSON is the custom JSON marshal function for the Address.
func (*Address) UnmarshalJSON ¶
UnmarshalJSON tries to unmarshal an Address from it's JSON representation. This method does not perform validation of the result address.
type Alias ¶
Alias represents the nickname tha could be attached to the Address.
func NewAliasFromBytes ¶
NewAliasFromBytes unmarshal an Alias from bytes and checks that it's valid.
func NewAliasFromString ¶
NewAliasFromString creates an Alias from its string representation. Function does not check that the result is a valid Alias. String representation of an Alias should have a following format: "alias:<scheme>:<alias>". Scheme should be represented with a one-byte ASCII symbol.
func (*Alias) MarshalBinary ¶
MarshalBinary converts the Alias to the slice of bytes. Just calls Bytes().
func (Alias) MarshalJSON ¶
MarshalJSON is a custom JSON marshalling function.
func (*Alias) Serialize ¶ added in v0.3.0
func (a *Alias) Serialize(s *serializer.Serializer) error
func (*Alias) UnmarshalBinary ¶
Reads an Alias from its bytes representation. This function does not validate the result.
func (*Alias) UnmarshalJSON ¶
UnmarshalJSON reads an Alias from JSON.
type Argument ¶ added in v0.3.0
type Argument interface { GetValueType() ArgumentValueType MarshalBinary() ([]byte, error) Serialize(*serializer.Serializer) error // contains filtered or unexported methods }
type ArgumentType ¶ added in v0.3.0
type ArgumentType struct {
Type string `json:"type"`
}
DataEntryType is the assistive structure used to get the type of DataEntry while unmarshal form JSON.
type ArgumentValueType ¶ added in v0.3.0
type ArgumentValueType byte
ValueType is an alias for byte that encodes the value type.
const ( ArgumentInteger ArgumentValueType = iota ArgumentBinary ArgumentString ArgumentBoolean )
func (ArgumentValueType) String ¶ added in v0.3.0
func (vt ArgumentValueType) String() string
String translates ValueType value to human readable name.
type Arguments ¶ added in v0.3.0
type Arguments []Argument
func (Arguments) MarshalBinary ¶ added in v0.3.0
func (Arguments) Serialize ¶ added in v0.3.0
func (a Arguments) Serialize(s *serializer.Serializer) error
func (*Arguments) UnmarshalBinary ¶ added in v0.3.0
func (*Arguments) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON custom JSON deserialization method.
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 NewAttachmentFromBase58 ¶ added in v0.1.2
func NewAttachmentFromBase58(s string) (Attachment, error)
NewAttachmentFromBase58 creates an Attachment structure from its base58 string representation.
func (Attachment) Bytes ¶ added in v0.3.0
func (a Attachment) Bytes() []byte
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 BinaryArgument ¶ added in v0.3.0
type BinaryArgument struct {
Value []byte
}
BinaryArgument represents an argument that stores binary value.
func NewBinaryArgument ¶ added in v0.3.0
func NewBinaryArgument(b []byte) *BinaryArgument
func (BinaryArgument) GetValueType ¶ added in v0.3.0
func (a BinaryArgument) GetValueType() ArgumentValueType
GetValueType returns the type of value (Binary) stored in an argument.
func (BinaryArgument) MarshalBinary ¶ added in v0.3.0
func (a BinaryArgument) MarshalBinary() ([]byte, error)
MarshalBinary writes an argument to its byte representation.
func (BinaryArgument) MarshalJSON ¶ added in v0.3.0
func (a BinaryArgument) MarshalJSON() ([]byte, error)
MarshalJSON converts an argument to its JSON representation. Note that BASE64 is used to represent the binary value.
func (BinaryArgument) Serialize ¶ added in v0.3.0
func (a BinaryArgument) Serialize(s *serializer.Serializer) error
Serialize argument to its byte representation.
func (*BinaryArgument) UnmarshalBinary ¶ added in v0.3.0
func (a *BinaryArgument) UnmarshalBinary(data []byte) error
UnmarshalBinary reads an argument from a binary representation.
func (*BinaryArgument) UnmarshalJSON ¶ added in v0.3.0
func (a *BinaryArgument) UnmarshalJSON(value []byte) error
UnmarshalJSON converts JSON to a BinaryArgument structure. Value should be stored as BASE64 sting in JSON.
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() DataValueType
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) MarshalValue ¶ added in v0.3.0
func (e BinaryDataEntry) MarshalValue() ([]byte, error)
MarshalValue writes an entry value to its byte representation.
func (*BinaryDataEntry) SetKey ¶ added in v0.3.0
func (e *BinaryDataEntry) SetKey(key string)
SetKey sets the key of data entry.
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.
func (*BinaryDataEntry) UnmarshalValue ¶ added in v0.3.0
func (e *BinaryDataEntry) UnmarshalValue(data []byte) error
UnmarshalValue reads an entry value from a binary representation.
func (BinaryDataEntry) Valid ¶ added in v0.3.0
func (e BinaryDataEntry) Valid() (bool, error)
type Block ¶ added in v0.2.0
type Block struct { BlockHeader Transactions *TransactionsRepresentation `json:"transactions,omitempty"` }
Block is a block of the blockchain
func CreateBlock ¶ added in v0.3.0
func CreateBlock(transactions *TransactionsRepresentation, timestamp Timestamp, parentSig crypto.Signature, publicKey crypto.PublicKey, NxtConsensus NxtConsensus, version BlockVersion) (*Block, error)
func (*Block) MarshalBinary ¶ added in v0.2.0
MarshalBinary encodes Block to binary form
func (*Block) UnmarshalBinary ¶ added in v0.2.0
UnmarshalBinary decodes Block from binary form
func (*Block) VerifySignature ¶ added in v0.3.0
type BlockHeader ¶ added in v0.2.0
type BlockHeader struct { Version BlockVersion `json:"version"` Timestamp uint64 `json:"timestamp"` Parent crypto.Signature `json:"reference"` FeaturesCount int `json:"-"` Features []int16 `json:"features,omitempty"` RewardVote int64 `json:"desiredReward"` ConsensusBlockLength uint32 `json:"-"` NxtConsensus `json:"nxt-consensus"` TransactionBlockLength uint32 `json:"transactionBlockLength,omitempty"` TransactionCount int `json:"transactionCount"` GenPublicKey crypto.PublicKey `json:"-"` BlockSignature crypto.Signature `json:"signature"` Height uint64 `json:"height"` }
Block info (except transactions)
func (*BlockHeader) MarshalHeaderToBinary ¶ added in v0.2.0
func (b *BlockHeader) MarshalHeaderToBinary() ([]byte, error)
func (*BlockHeader) UnmarshalHeaderFromBinary ¶ added in v0.2.0
func (b *BlockHeader) UnmarshalHeaderFromBinary(data []byte) (err error)
type BlockInfo ¶ added in v0.3.0
type BlockInfo struct { Timestamp uint64 Height uint64 BaseTarget uint64 GenerationSignature crypto.Digest Generator Address GeneratorPublicKey crypto.PublicKey }
func BlockInfoFromHeader ¶ added in v0.3.0
func BlockInfoFromHeader(scheme byte, header *BlockHeader, height uint64) (*BlockInfo, error)
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 BlockVersion ¶ added in v0.3.0
type BlockVersion byte
const ( GenesisBlockVersion BlockVersion = iota + 1 PlainBlockVersion NgBlockVersion RewardBlockVersion )
type BooleanArgument ¶ added in v0.3.0
type BooleanArgument struct {
Value bool
}
BooleanArgument represents a key-value pair that stores a bool value.
func NewBooleanArgument ¶ added in v0.3.0
func NewBooleanArgument(b bool) *BooleanArgument
func (BooleanArgument) GetValueType ¶ added in v0.3.0
func (a BooleanArgument) GetValueType() ArgumentValueType
GetValueType returns the data type (Boolean) of the argument.
func (BooleanArgument) MarshalBinary ¶ added in v0.3.0
func (a BooleanArgument) MarshalBinary() ([]byte, error)
MarshalBinary writes a byte representation of the boolean data entry.
func (BooleanArgument) MarshalJSON ¶ added in v0.3.0
func (a BooleanArgument) MarshalJSON() ([]byte, error)
MarshalJSON writes the argument to a JSON representation.
func (BooleanArgument) Serialize ¶ added in v0.3.0
func (a BooleanArgument) Serialize(s *serializer.Serializer) error
Serialize argument to its byte representation.
func (*BooleanArgument) UnmarshalBinary ¶ added in v0.3.0
func (a *BooleanArgument) UnmarshalBinary(data []byte) error
UnmarshalBinary reads a byte representation of the data entry.
func (*BooleanArgument) UnmarshalJSON ¶ added in v0.3.0
func (a *BooleanArgument) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from its JSON representation.
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() DataValueType
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) MarshalValue ¶ added in v0.3.0
func (e BooleanDataEntry) MarshalValue() ([]byte, error)
MarshalValue writes a byte representation of the boolean data entry value.
func (*BooleanDataEntry) SetKey ¶ added in v0.3.0
func (e *BooleanDataEntry) SetKey(key string)
SetKey sets the key of data entry.
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.
func (*BooleanDataEntry) UnmarshalValue ¶ added in v0.3.0
func (e *BooleanDataEntry) UnmarshalValue(data []byte) error
UnmarshalValue reads a byte representation of the data entry value.
func (BooleanDataEntry) Valid ¶ added in v0.3.0
func (e BooleanDataEntry) Valid() (bool, error)
type BulkMessage ¶ added in v0.3.0
type BulkMessage []Message
func (BulkMessage) MarshalBinary ¶ added in v0.3.0
func (a BulkMessage) MarshalBinary() (data []byte, err error)
func (BulkMessage) ReadFrom ¶ added in v0.3.0
func (BulkMessage) ReadFrom(r io.Reader) (n int64, err error)
func (BulkMessage) UnmarshalBinary ¶ added in v0.3.0
func (BulkMessage) UnmarshalBinary(data []byte) error
type Burn ¶ added in v0.3.0
type Burn struct { SenderPK crypto.PublicKey `json:"senderPublicKey"` AssetID crypto.Digest `json:"assetId"` Amount uint64 `json:"amount"` Timestamp uint64 `json:"timestamp,omitempty"` Fee uint64 `json:"fee"` }
func (Burn) GetSenderPK ¶ added in v0.3.0
func (Burn) GetTimestamp ¶ added in v0.3.0
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"` Burn }
BurnV1 transaction allows to decrease the total supply of the existing asset. Asset must be reissuable.
func NewUnsignedBurnV1 ¶
func NewUnsignedBurnV1(senderPK crypto.PublicKey, assetID crypto.Digest, amount, timestamp, fee uint64) *BurnV1
NewUnsignedBurnV1 creates new BurnV1 transaction with no signature and ID.
func (*BurnV1) BodyMarshalBinary ¶ added in v0.3.0
func (*BurnV1) GenerateID ¶ added in v0.3.0
func (tx *BurnV1) GenerateID()
func (BurnV1) GetTypeVersion ¶ added in v0.3.0
func (tx BurnV1) GetTypeVersion() TransactionTypeVersion
func (*BurnV1) MarshalBinary ¶
MarshalBinary saves transaction to
func (*BurnV1) UnmarshalBinary ¶
UnmarshalBinary reads transaction form its binary representation.
type BurnV2 ¶ added in v0.1.2
type BurnV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ChainID byte `json:"-"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` Burn }
BurnV2 same as BurnV1 but version 2 with Proofs.
func NewUnsignedBurnV2 ¶ added in v0.1.2
func NewUnsignedBurnV2(chainID byte, senderPK crypto.PublicKey, assetID crypto.Digest, amount, timestamp, fee uint64) *BurnV2
NewUnsignedBurnV2 creates new BurnV2 transaction without proofs and ID.
func (*BurnV2) BodyMarshalBinary ¶ added in v0.3.0
func (*BurnV2) GenerateID ¶ added in v0.3.0
func (tx *BurnV2) GenerateID()
func (BurnV2) GetTypeVersion ¶ added in v0.3.0
func (tx BurnV2) GetTypeVersion() TransactionTypeVersion
func (*BurnV2) MarshalBinary ¶ added in v0.1.2
MarshalBinary writes BurnV2 transaction to its bytes representation.
func (*BurnV2) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads BurnV2 from its bytes representation.
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 ¶
CheckpointItem represents a Checkpoint
type CreateAlias ¶ added in v0.3.0
type CreateAlias struct { SenderPK crypto.PublicKey `json:"senderPublicKey"` Alias Alias `json:"alias"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func (CreateAlias) GetFee ¶ added in v0.3.0
func (ca CreateAlias) GetFee() uint64
func (CreateAlias) GetSenderPK ¶ added in v0.3.0
func (ca CreateAlias) GetSenderPK() crypto.PublicKey
func (CreateAlias) GetTimestamp ¶ added in v0.3.0
func (ca CreateAlias) GetTimestamp() uint64
func (CreateAlias) Valid ¶ added in v0.3.0
func (ca CreateAlias) Valid() (bool, error)
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"` CreateAlias }
func NewUnsignedCreateAliasV1 ¶
func NewUnsignedCreateAliasV1(senderPK crypto.PublicKey, alias Alias, fee, timestamp uint64) *CreateAliasV1
func (*CreateAliasV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *CreateAliasV1) BodyMarshalBinary() ([]byte, error)
func (*CreateAliasV1) Clone ¶ added in v0.3.0
func (tx *CreateAliasV1) Clone() *CreateAliasV1
func (*CreateAliasV1) GenerateID ¶ added in v0.3.0
func (tx *CreateAliasV1) GenerateID()
func (CreateAliasV1) GetID ¶ added in v0.2.0
func (tx CreateAliasV1) GetID() ([]byte, error)
func (CreateAliasV1) GetTypeVersion ¶ added in v0.3.0
func (tx CreateAliasV1) GetTypeVersion() TransactionTypeVersion
func (*CreateAliasV1) MarshalBinary ¶
func (tx *CreateAliasV1) MarshalBinary() ([]byte, error)
func (*CreateAliasV1) UnmarshalBinary ¶
func (tx *CreateAliasV1) UnmarshalBinary(data []byte) error
func (*CreateAliasV1) UnmarshalJSON ¶ added in v0.2.0
func (tx *CreateAliasV1) UnmarshalJSON(data []byte) error
type CreateAliasV2 ¶ added in v0.1.2
type CreateAliasV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` CreateAlias }
func NewUnsignedCreateAliasV2 ¶ added in v0.1.2
func NewUnsignedCreateAliasV2(senderPK crypto.PublicKey, alias Alias, fee, timestamp uint64) *CreateAliasV2
func (*CreateAliasV2) BodyMarshalBinary ¶ added in v0.3.0
func (tx *CreateAliasV2) BodyMarshalBinary() ([]byte, error)
func (*CreateAliasV2) Clone ¶ added in v0.3.0
func (tx *CreateAliasV2) Clone() *CreateAliasV2
func (*CreateAliasV2) GenerateID ¶ added in v0.3.0
func (tx *CreateAliasV2) GenerateID()
func (CreateAliasV2) GetID ¶ added in v0.2.0
func (tx CreateAliasV2) GetID() ([]byte, error)
func (CreateAliasV2) GetTypeVersion ¶ added in v0.3.0
func (tx CreateAliasV2) GetTypeVersion() TransactionTypeVersion
func (*CreateAliasV2) MarshalBinary ¶ added in v0.1.2
func (tx *CreateAliasV2) MarshalBinary() ([]byte, error)
MarshalBinary saves the transaction to its binary representation.
func (*CreateAliasV2) Sign ¶ added in v0.1.2
func (tx *CreateAliasV2) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*CreateAliasV2) UnmarshalBinary ¶ added in v0.1.2
func (tx *CreateAliasV2) UnmarshalBinary(data []byte) error
UnmarshalBinary reads the transaction from bytes slice.
func (*CreateAliasV2) UnmarshalJSON ¶ added in v0.2.0
func (tx *CreateAliasV2) UnmarshalJSON(data []byte) error
type DataEntries ¶ added in v0.2.0
type DataEntries []DataEntry
DataEntries the slice of various entries of DataTransaction
func (*DataEntries) UnmarshalJSON ¶ added in v0.2.0
func (e *DataEntries) UnmarshalJSON(data []byte) error
UnmarshalJSOL special method to unmarshal DataEntries from JSON with detection of real type of each entry.
type DataEntry ¶
type DataEntry interface { GetKey() string SetKey(string) GetValueType() DataValueType MarshalValue() ([]byte, error) UnmarshalValue([]byte) error MarshalBinary() ([]byte, error) UnmarshalBinary([]byte) error Valid() (bool, 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.
func NewDataEntryFromValueBytes ¶ added in v0.3.0
type DataEntryType ¶ added in v0.2.0
type DataEntryType struct {
Type string `json:"type"`
}
DataEntryType is the assistive structure used to get the type of DataEntry while unmarshal form JSON.
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 DataEntries `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) BodyMarshalBinary ¶ added in v0.2.0
func (*DataV1) GenerateID ¶ added in v0.3.0
func (tx *DataV1) GenerateID()
func (DataV1) GetSenderPK ¶ added in v0.3.0
func (DataV1) GetTimestamp ¶ added in v0.3.0
func (DataV1) GetTypeVersion ¶ added in v0.3.0
func (tx DataV1) GetTypeVersion() TransactionTypeVersion
func (*DataV1) MarshalBinary ¶
MarshalBinary saves the transaction to bytes.
func (*DataV1) UnmarshalBinary ¶
UnmarshalBinary reads the transaction from the bytes.
type DataValueType ¶ added in v0.3.0
type DataValueType byte
ValueType is an alias for byte that encodes the value type.
const ( DataInteger DataValueType = iota DataBoolean DataBinary DataString )
Supported value types.
func (DataValueType) String ¶ added in v0.3.0
func (vt DataValueType) String() string
String translates ValueType value to human readable name.
type Exchange ¶ added in v0.3.0
type Exchange interface { GetID() ([]byte, error) GetSenderPK() crypto.PublicKey GetBuyOrder() (OrderBody, error) GetSellOrder() (OrderBody, error) GetBuyOrderFull() Order GetSellOrderFull() Order GetPrice() uint64 GetAmount() uint64 GetBuyMatcherFee() uint64 GetSellMatcherFee() uint64 GetFee() uint64 GetTimestamp() uint64 }
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 *OrderV1 `json:"order1"` SellOrder *OrderV1 `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"` }
ExchangeV1 is a transaction to store settlement on blockchain.
func NewUnsignedExchangeV1 ¶
func NewUnsignedExchangeV1(buy, sell *OrderV1, price, amount, buyMatcherFee, sellMatcherFee, fee, timestamp uint64) *ExchangeV1
func (*ExchangeV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *ExchangeV1) BodyMarshalBinary() ([]byte, error)
func (*ExchangeV1) BodySerialize ¶ added in v0.3.0
func (tx *ExchangeV1) BodySerialize(s *serializer.Serializer) error
func (*ExchangeV1) Clone ¶ added in v0.3.0
func (tx *ExchangeV1) Clone() *ExchangeV1
func (*ExchangeV1) GenerateID ¶ added in v0.3.0
func (tx *ExchangeV1) GenerateID()
func (ExchangeV1) GetAmount ¶ added in v0.3.0
func (tx ExchangeV1) GetAmount() uint64
func (ExchangeV1) GetBuyMatcherFee ¶ added in v0.3.0
func (tx ExchangeV1) GetBuyMatcherFee() uint64
func (ExchangeV1) GetBuyOrder ¶ added in v0.3.0
func (tx ExchangeV1) GetBuyOrder() (OrderBody, error)
func (ExchangeV1) GetBuyOrderFull ¶ added in v0.3.0
func (tx ExchangeV1) GetBuyOrderFull() Order
func (ExchangeV1) GetFee ¶ added in v0.3.0
func (tx ExchangeV1) GetFee() uint64
func (ExchangeV1) GetID ¶ added in v0.2.0
func (tx ExchangeV1) GetID() ([]byte, error)
func (ExchangeV1) GetPrice ¶ added in v0.3.0
func (tx ExchangeV1) GetPrice() uint64
func (ExchangeV1) GetSellMatcherFee ¶ added in v0.3.0
func (tx ExchangeV1) GetSellMatcherFee() uint64
func (ExchangeV1) GetSellOrder ¶ added in v0.3.0
func (tx ExchangeV1) GetSellOrder() (OrderBody, error)
func (ExchangeV1) GetSellOrderFull ¶ added in v0.3.0
func (tx ExchangeV1) GetSellOrderFull() Order
func (ExchangeV1) GetSenderPK ¶ added in v0.3.0
func (tx ExchangeV1) GetSenderPK() crypto.PublicKey
func (ExchangeV1) GetTimestamp ¶ added in v0.3.0
func (tx ExchangeV1) GetTimestamp() uint64
func (ExchangeV1) GetTypeVersion ¶ added in v0.3.0
func (tx ExchangeV1) GetTypeVersion() TransactionTypeVersion
func (*ExchangeV1) MarshalBinary ¶
func (tx *ExchangeV1) MarshalBinary() ([]byte, error)
MarshalBinary saves the transaction to its binary representation.
func (*ExchangeV1) Sign ¶
func (tx *ExchangeV1) Sign(secretKey crypto.SecretKey) error
Sing calculates ID and Signature of the transaction.
func (*ExchangeV1) UnmarshalBinary ¶
func (tx *ExchangeV1) UnmarshalBinary(data []byte) error
UnmarshalBinary loads the transaction from its binary representation.
func (ExchangeV1) Valid ¶ added in v0.3.0
func (tx ExchangeV1) Valid() (bool, error)
type ExchangeV2 ¶ added in v0.1.2
type ExchangeV2 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"` 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"` }
ExchangeV2 is a transaction to store settlement on blockchain.
func NewUnsignedExchangeV2 ¶ added in v0.1.2
func NewUnsignedExchangeV2(buy, sell Order, price, amount, buyMatcherFee, sellMatcherFee, fee, timestamp uint64) *ExchangeV2
func (*ExchangeV2) BodyMarshalBinary ¶ added in v0.3.0
func (tx *ExchangeV2) BodyMarshalBinary() ([]byte, error)
func (*ExchangeV2) Clone ¶ added in v0.3.0
func (tx *ExchangeV2) Clone() *ExchangeV2
func (*ExchangeV2) GenerateID ¶ added in v0.3.0
func (tx *ExchangeV2) GenerateID()
func (ExchangeV2) GetAmount ¶ added in v0.3.0
func (tx ExchangeV2) GetAmount() uint64
func (ExchangeV2) GetBuyMatcherFee ¶ added in v0.3.0
func (tx ExchangeV2) GetBuyMatcherFee() uint64
func (ExchangeV2) GetBuyOrder ¶ added in v0.3.0
func (tx ExchangeV2) GetBuyOrder() (OrderBody, error)
func (ExchangeV2) GetBuyOrderFull ¶ added in v0.3.0
func (tx ExchangeV2) GetBuyOrderFull() Order
func (ExchangeV2) GetFee ¶ added in v0.3.0
func (tx ExchangeV2) GetFee() uint64
func (ExchangeV2) GetID ¶ added in v0.2.0
func (tx ExchangeV2) GetID() ([]byte, error)
func (ExchangeV2) GetPrice ¶ added in v0.3.0
func (tx ExchangeV2) GetPrice() uint64
func (ExchangeV2) GetSellMatcherFee ¶ added in v0.3.0
func (tx ExchangeV2) GetSellMatcherFee() uint64
func (ExchangeV2) GetSellOrder ¶ added in v0.3.0
func (tx ExchangeV2) GetSellOrder() (OrderBody, error)
func (ExchangeV2) GetSellOrderFull ¶ added in v0.3.0
func (tx ExchangeV2) GetSellOrderFull() Order
func (ExchangeV2) GetSenderPK ¶ added in v0.3.0
func (tx ExchangeV2) GetSenderPK() crypto.PublicKey
func (ExchangeV2) GetTimestamp ¶ added in v0.3.0
func (tx ExchangeV2) GetTimestamp() uint64
func (ExchangeV2) GetTypeVersion ¶ added in v0.3.0
func (tx ExchangeV2) GetTypeVersion() TransactionTypeVersion
func (*ExchangeV2) MarshalBinary ¶ added in v0.1.2
func (tx *ExchangeV2) MarshalBinary() ([]byte, error)
MarshalBinary saves the transaction to its binary representation.
func (*ExchangeV2) Sign ¶ added in v0.1.2
func (tx *ExchangeV2) Sign(secretKey crypto.SecretKey) error
Sign calculates transaction signature using given secret key.
func (*ExchangeV2) UnmarshalBinary ¶ added in v0.1.2
func (tx *ExchangeV2) UnmarshalBinary(data []byte) error
UnmarshalBinary loads the transaction from its binary representation.
func (*ExchangeV2) UnmarshalJSON ¶ added in v0.2.0
func (tx *ExchangeV2) UnmarshalJSON(data []byte) error
func (ExchangeV2) Valid ¶ added in v0.3.0
func (tx ExchangeV2) Valid() (bool, error)
type FullScriptTransfer ¶ added in v0.3.0
type FullScriptTransfer struct { ScriptResultTransfer Sender Address Timestamp uint64 ID *crypto.Digest }
func NewFullScriptTransfer ¶ added in v0.3.0
func NewFullScriptTransfer(scheme byte, tr *ScriptResultTransfer, tx *InvokeScriptV1) (*FullScriptTransfer, error)
type FunctionCall ¶ added in v0.3.0
FunctionCall structure represents the description of function called in the InvokeScript transaction.
func (FunctionCall) MarshalBinary ¶ added in v0.3.0
func (c FunctionCall) MarshalBinary() ([]byte, error)
func (FunctionCall) MarshalJSON ¶ added in v0.3.0
func (c FunctionCall) MarshalJSON() ([]byte, error)
MarshalJSON writes the entry to its JSON representation.
func (FunctionCall) Serialize ¶ added in v0.3.0
func (c FunctionCall) Serialize(s *serializer.Serializer) error
func (*FunctionCall) UnmarshalBinary ¶ added in v0.3.0
func (c *FunctionCall) UnmarshalBinary(data []byte) error
func (*FunctionCall) UnmarshalJSON ¶ added in v0.3.0
func (c *FunctionCall) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from JSON.
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"` }
Genesis is a transaction used to initial balances distribution. This transactions allowed only in the first block.
func NewUnsignedGenesis ¶
NewUnsignedGenesis returns a new unsigned Genesis transaction. Actually Genesis transaction could not be signed. That is why it doesn't implement Sing method. Instead it has GenerateSigID method, which calculates ID and uses it also as a signature.
func (*Genesis) GenerateID ¶ added in v0.3.0
func (tx *Genesis) GenerateID()
func (*Genesis) GenerateSigID ¶
GenerateSigID calculates hash of the transaction and use it as an ID. Also doubled hash is used as a signature.
func (Genesis) GetSenderPK ¶ added in v0.3.0
func (Genesis) GetTimestamp ¶ added in v0.3.0
func (Genesis) GetTypeVersion ¶ added in v0.3.0
func (tx Genesis) GetTypeVersion() TransactionTypeVersion
func (*Genesis) MarshalBinary ¶
MarshalBinary writes transaction bytes to slice of bytes.
func (*Genesis) UnmarshalBinary ¶
UnmarshalBinary reads transaction values from the slice of bytes.
type GetBlockMessage ¶
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 ¶
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 { AppName string Version Version NodeName string NodeNonce uint64 DeclaredAddr HandshakeTCPAddr Timestamp uint64 }
Handshake is the handshake structure of the waves protocol
type HandshakeTCPAddr ¶ added in v0.3.0
type HandshakeTCPAddr TCPAddr
func NewHandshakeTCPAddr ¶ added in v0.3.0
func NewHandshakeTCPAddr(ip net.IP, port int) HandshakeTCPAddr
func ParseHandshakeTCPAddr ¶ added in v0.3.0
func ParseHandshakeTCPAddr(s string) HandshakeTCPAddr
func (HandshakeTCPAddr) Empty ¶ added in v0.3.0
func (a HandshakeTCPAddr) Empty() bool
func (HandshakeTCPAddr) Network ¶ added in v0.3.0
func (a HandshakeTCPAddr) Network() string
func (*HandshakeTCPAddr) ReadFrom ¶ added in v0.3.0
func (a *HandshakeTCPAddr) ReadFrom(r io.Reader) (int64, error)
func (HandshakeTCPAddr) String ¶ added in v0.3.0
func (a HandshakeTCPAddr) String() string
func (HandshakeTCPAddr) ToIpPort ¶ added in v0.3.0
func (a HandshakeTCPAddr) ToIpPort() IpPort
type Header ¶ added in v0.3.0
type Header struct { Length uint32 Magic uint32 ContentID uint8 PayloadLength uint32 PayloadCsum [headerCsumLen]byte }
func (*Header) HeaderLength ¶ added in v0.3.0
func (*Header) MarshalBinary ¶ added in v0.3.0
func (*Header) UnmarshalBinary ¶ added in v0.3.0
type IntegerArgument ¶ added in v0.3.0
type IntegerArgument struct {
Value int64
}
func NewIntegerArgument ¶ added in v0.3.0
func NewIntegerArgument(i int64) *IntegerArgument
func (IntegerArgument) GetValueType ¶ added in v0.3.0
func (a IntegerArgument) GetValueType() ArgumentValueType
GetValueType returns the value type of the entry.
func (IntegerArgument) MarshalBinary ¶ added in v0.3.0
func (a IntegerArgument) MarshalBinary() ([]byte, error)
MarshalBinary marshals the integer argument in its bytes representation.
func (IntegerArgument) MarshalJSON ¶ added in v0.3.0
func (a IntegerArgument) MarshalJSON() ([]byte, error)
MarshalJSON writes a JSON representation of integer argument.
func (IntegerArgument) Serialize ¶ added in v0.3.0
func (a IntegerArgument) Serialize(s *serializer.Serializer) error
Serialize the integer argument in its bytes representation.
func (*IntegerArgument) UnmarshalBinary ¶ added in v0.3.0
func (a *IntegerArgument) UnmarshalBinary(data []byte) error
UnmarshalBinary reads binary representation of integer argument to the structure.
func (*IntegerArgument) UnmarshalJSON ¶ added in v0.3.0
func (a *IntegerArgument) UnmarshalJSON(value []byte) error
UnmarshalJSON reads an integer argument from its JSON representation.
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() DataValueType
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) MarshalValue ¶ added in v0.3.0
func (e IntegerDataEntry) MarshalValue() ([]byte, error)
MarshalValue marshals the integer data entry value in its bytes representation.
func (*IntegerDataEntry) SetKey ¶ added in v0.3.0
func (e *IntegerDataEntry) SetKey(key string)
SetKey sets the key of 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.
func (*IntegerDataEntry) UnmarshalValue ¶ added in v0.3.0
func (e *IntegerDataEntry) UnmarshalValue(data []byte) error
UnmarshalBinary reads binary representation of integer data entry value to the structure.
func (IntegerDataEntry) Valid ¶ added in v0.3.0
func (e IntegerDataEntry) Valid() (bool, error)
type InvokeScriptV1 ¶ added in v0.3.0
type InvokeScriptV1 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"` ScriptRecipient Recipient `json:"dApp"` FunctionCall FunctionCall `json:"call"` Payments ScriptPayments `json:"payment"` FeeAsset OptionalAsset `json:"feeAssetId"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func NewUnsignedInvokeScriptV1 ¶ added in v0.3.0
func NewUnsignedInvokeScriptV1(chain byte, senderPK crypto.PublicKey, scriptRecipient Recipient, call FunctionCall, payments ScriptPayments, feeAsset OptionalAsset, fee, timestamp uint64) *InvokeScriptV1
NewUnsignedSetAssetScriptV1 creates new unsigned SetAssetScriptV1 transaction.
func (*InvokeScriptV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *InvokeScriptV1) BodyMarshalBinary() ([]byte, error)
func (*InvokeScriptV1) BodySerialize ¶ added in v0.3.0
func (tx *InvokeScriptV1) BodySerialize(s *serializer.Serializer) error
func (*InvokeScriptV1) Clone ¶ added in v0.3.0
func (tx *InvokeScriptV1) Clone() *InvokeScriptV1
func (*InvokeScriptV1) GenerateID ¶ added in v0.3.0
func (tx *InvokeScriptV1) GenerateID()
func (InvokeScriptV1) GetFee ¶ added in v0.3.0
func (tx InvokeScriptV1) GetFee() uint64
func (InvokeScriptV1) GetID ¶ added in v0.3.0
func (tx InvokeScriptV1) GetID() ([]byte, error)
func (InvokeScriptV1) GetSenderPK ¶ added in v0.3.0
func (tx InvokeScriptV1) GetSenderPK() crypto.PublicKey
func (InvokeScriptV1) GetTimestamp ¶ added in v0.3.0
func (tx InvokeScriptV1) GetTimestamp() uint64
func (InvokeScriptV1) GetTypeVersion ¶ added in v0.3.0
func (tx InvokeScriptV1) GetTypeVersion() TransactionTypeVersion
func (*InvokeScriptV1) MarshalBinary ¶ added in v0.3.0
func (tx *InvokeScriptV1) MarshalBinary() ([]byte, error)
MarshalBinary writes InvokeScriptV1 transaction to its bytes representation.
func (*InvokeScriptV1) Serialize ¶ added in v0.3.0
func (tx *InvokeScriptV1) Serialize(s *serializer.Serializer) error
Serialize InvokeScriptV1 transaction to its bytes representation.
func (*InvokeScriptV1) Sign ¶ added in v0.3.0
func (tx *InvokeScriptV1) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*InvokeScriptV1) UnmarshalBinary ¶ added in v0.3.0
func (tx *InvokeScriptV1) UnmarshalBinary(data []byte) error
UnmarshalBinary reads InvokeScriptV1 transaction from its binary representation.
func (InvokeScriptV1) Valid ¶ added in v0.3.0
func (tx InvokeScriptV1) Valid() (bool, error)
type IpPort ¶ added in v0.3.0
type IpPort [IpPortLength]byte
func NewIpPortFromTcpAddr ¶ added in v0.3.0
func (*IpPort) UnmarshalBinary ¶ added in v0.3.0
type Issue ¶ added in v0.3.0
type Issue struct { 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 (Issue) GetSenderPK ¶ added in v0.3.0
func (Issue) GetTimestamp ¶ added in v0.3.0
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"` Issue }
IssueV1 transaction is a transaction to issue new asset.
func NewUnsignedIssueV1 ¶
func NewUnsignedIssueV1(senderPK crypto.PublicKey, name, description string, quantity uint64, decimals byte, reissuable bool, timestamp, fee uint64) *IssueV1
NewUnsignedIssueV1 creates new IssueV1 transaction without signature and ID.
func (*IssueV1) BodyMarshalBinary ¶ added in v0.3.0
func (*IssueV1) GenerateID ¶ added in v0.3.0
func (tx *IssueV1) GenerateID()
func (IssueV1) GetTypeVersion ¶ added in v0.3.0
func (tx IssueV1) GetTypeVersion() TransactionTypeVersion
func (*IssueV1) MarshalBinary ¶
MarshalBinary saves transaction's binary representation to slice of bytes.
func (*IssueV1) UnmarshalBinary ¶
UnmarshalBinary reads transaction from its binary representation.
type IssueV2 ¶ added in v0.1.2
type IssueV2 struct { Type TransactionType `json:"type"` Version byte `json:"version"` ChainID byte `json:"-"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` Script Script `json:"script"` Issue }
IssueV2 is a transaction to issue new asset, second version.
func NewUnsignedIssueV2 ¶ added in v0.1.2
func NewUnsignedIssueV2(chainID byte, senderPK crypto.PublicKey, name, description string, quantity uint64, decimals byte, reissuable bool, script []byte, timestamp, fee uint64) *IssueV2
NewUnsignedIssueV2 creates a new IssueV2 transaction with empty Proofs.
func (*IssueV2) BodyMarshalBinary ¶ added in v0.3.0
func (*IssueV2) GenerateID ¶ added in v0.3.0
func (tx *IssueV2) GenerateID()
func (IssueV2) GetTypeVersion ¶ added in v0.3.0
func (tx IssueV2) GetTypeVersion() TransactionTypeVersion
func (*IssueV2) MarshalBinary ¶ added in v0.1.2
MarshalBinary converts transaction to its binary representation.
func (*IssueV2) NonEmptyScript ¶ added in v0.1.2
NonEmptyScript returns true if the script of the transaction is not empty, otherwise false.
func (*IssueV2) Sign ¶ added in v0.1.2
Sign calculates transaction signature using given secret key.
func (*IssueV2) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads transaction from its binary representation.
type KeyPair ¶ added in v0.3.0
type KeyPair struct {
// contains filtered or unexported fields
}
func NewKeyPair ¶ added in v0.3.0
type Lease ¶ added in v0.3.0
type Lease struct { SenderPK crypto.PublicKey `json:"senderPublicKey"` Recipient Recipient `json:"recipient"` Amount uint64 `json:"amount"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func (Lease) GetSenderPK ¶ added in v0.3.0
func (Lease) GetTimestamp ¶ added in v0.3.0
type LeaseCancel ¶ added in v0.3.0
type LeaseCancel struct { SenderPK crypto.PublicKey `json:"senderPublicKey"` LeaseID crypto.Digest `json:"leaseId"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
func (LeaseCancel) GetFee ¶ added in v0.3.0
func (lc LeaseCancel) GetFee() uint64
func (LeaseCancel) GetSenderPK ¶ added in v0.3.0
func (lc LeaseCancel) GetSenderPK() crypto.PublicKey
func (LeaseCancel) GetTimestamp ¶ added in v0.3.0
func (lc LeaseCancel) GetTimestamp() uint64
func (LeaseCancel) Valid ¶ added in v0.3.0
func (lc LeaseCancel) Valid() (bool, error)
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"` LeaseCancel }
LeaseCancelV1 transaction can be used to cancel previously created leasing.
func NewUnsignedLeaseCancelV1 ¶
func NewUnsignedLeaseCancelV1(senderPK crypto.PublicKey, leaseID crypto.Digest, fee, timestamp uint64) *LeaseCancelV1
NewUnsignedLeaseCancelV1 creates new LeaseCancelV1 transaction structure without a signature and an ID.
func (*LeaseCancelV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *LeaseCancelV1) BodyMarshalBinary() ([]byte, error)
func (*LeaseCancelV1) Clone ¶ added in v0.3.0
func (tx *LeaseCancelV1) Clone() *LeaseCancelV1
func (*LeaseCancelV1) GenerateID ¶ added in v0.3.0
func (tx *LeaseCancelV1) GenerateID()
func (LeaseCancelV1) GetID ¶ added in v0.2.0
func (tx LeaseCancelV1) GetID() ([]byte, error)
func (LeaseCancelV1) GetTypeVersion ¶ added in v0.3.0
func (tx LeaseCancelV1) GetTypeVersion() TransactionTypeVersion
func (*LeaseCancelV1) MarshalBinary ¶
func (tx *LeaseCancelV1) MarshalBinary() ([]byte, error)
MarshalBinary saves transaction to its binary representation.
func (*LeaseCancelV1) UnmarshalBinary ¶
func (tx *LeaseCancelV1) UnmarshalBinary(data []byte) error
type LeaseCancelV2 ¶ added in v0.1.2
type LeaseCancelV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ChainID byte `json:"-"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` LeaseCancel }
LeaseCancelV2 same as LeaseCancelV1 but with proofs.
func NewUnsignedLeaseCancelV2 ¶ added in v0.1.2
func NewUnsignedLeaseCancelV2(chainID byte, senderPK crypto.PublicKey, leaseID crypto.Digest, fee, timestamp uint64) *LeaseCancelV2
NewUnsignedLeaseCancelV2 creates new LeaseCancelV2 transaction structure without a signature and an ID.
func (*LeaseCancelV2) BodyMarshalBinary ¶ added in v0.3.0
func (tx *LeaseCancelV2) BodyMarshalBinary() ([]byte, error)
func (*LeaseCancelV2) Clone ¶ added in v0.3.0
func (tx *LeaseCancelV2) Clone() *LeaseCancelV2
func (*LeaseCancelV2) GenerateID ¶ added in v0.3.0
func (tx *LeaseCancelV2) GenerateID()
func (LeaseCancelV2) GetID ¶ added in v0.2.0
func (tx LeaseCancelV2) GetID() ([]byte, error)
func (LeaseCancelV2) GetTypeVersion ¶ added in v0.3.0
func (tx LeaseCancelV2) GetTypeVersion() TransactionTypeVersion
func (*LeaseCancelV2) MarshalBinary ¶ added in v0.1.2
func (tx *LeaseCancelV2) MarshalBinary() ([]byte, error)
MarshalBinary saves the transaction to its binary representation.
func (*LeaseCancelV2) Sign ¶ added in v0.1.2
func (tx *LeaseCancelV2) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*LeaseCancelV2) UnmarshalBinary ¶ added in v0.1.2
func (tx *LeaseCancelV2) UnmarshalBinary(data []byte) error
UnmarshalBinary reads the transaction from bytes slice.
func (LeaseCancelV2) Valid ¶ added in v0.3.0
func (tx LeaseCancelV2) Valid() (bool, 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"` Lease }
LeaseV1 is a transaction that allows to lease Waves to other account.
func NewUnsignedLeaseV1 ¶
func NewUnsignedLeaseV1(senderPK crypto.PublicKey, recipient Recipient, amount, fee, timestamp uint64) *LeaseV1
NewUnsignedLeaseV1 creates new LeaseV1 transaction without signature and ID set.
func (*LeaseV1) BodyMarshalBinary ¶ added in v0.3.0
func (*LeaseV1) GenerateID ¶ added in v0.3.0
func (tx *LeaseV1) GenerateID()
func (LeaseV1) GetTypeVersion ¶ added in v0.3.0
func (tx LeaseV1) GetTypeVersion() TransactionTypeVersion
func (*LeaseV1) MarshalBinary ¶
MarshalBinary saves the transaction to its binary representation.
func (*LeaseV1) UnmarshalBinary ¶
UnmarshalBinary reads the transaction from bytes slice.
type LeaseV2 ¶ added in v0.1.2
type LeaseV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` Lease }
LeaseV2 is a second version of the LeaseV1 transaction.
func NewUnsignedLeaseV2 ¶ added in v0.1.2
func NewUnsignedLeaseV2(senderPK crypto.PublicKey, recipient Recipient, amount, fee, timestamp uint64) *LeaseV2
NewUnsignedLeaseV2 creates new LeaseV1 transaction without signature and ID set.
func (*LeaseV2) BodyMarshalBinary ¶ added in v0.3.0
func (*LeaseV2) GenerateID ¶ added in v0.3.0
func (tx *LeaseV2) GenerateID()
func (LeaseV2) GetTypeVersion ¶ added in v0.3.0
func (tx LeaseV2) GetTypeVersion() TransactionTypeVersion
func (*LeaseV2) MarshalBinary ¶ added in v0.1.2
MarshalBinary saves the transaction to its binary representation.
func (*LeaseV2) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads the transaction from bytes slice.
type MassTransferEntry ¶
type MassTransferEntry struct { Recipient Recipient `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"` }
MassTransferV1 is a transaction that performs multiple transfers of one asset to the accounts at once.
func NewUnsignedMassTransferV1 ¶
func NewUnsignedMassTransferV1(senderPK crypto.PublicKey, asset OptionalAsset, transfers []MassTransferEntry, fee, timestamp uint64, attachment string) *MassTransferV1
NewUnsignedMassTransferV1 creates new MassTransferV1 transaction structure without signature and ID.
func (*MassTransferV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *MassTransferV1) BodyMarshalBinary() ([]byte, error)
func (*MassTransferV1) Clone ¶ added in v0.3.0
func (tx *MassTransferV1) Clone() *MassTransferV1
func (*MassTransferV1) GenerateID ¶ added in v0.3.0
func (tx *MassTransferV1) GenerateID()
func (MassTransferV1) GetFee ¶ added in v0.3.0
func (tx MassTransferV1) GetFee() uint64
func (MassTransferV1) GetID ¶ added in v0.2.0
func (tx MassTransferV1) GetID() ([]byte, error)
func (MassTransferV1) GetSenderPK ¶ added in v0.3.0
func (tx MassTransferV1) GetSenderPK() crypto.PublicKey
func (MassTransferV1) GetTimestamp ¶ added in v0.3.0
func (tx MassTransferV1) GetTimestamp() uint64
func (MassTransferV1) GetTypeVersion ¶ added in v0.3.0
func (tx MassTransferV1) GetTypeVersion() TransactionTypeVersion
func (*MassTransferV1) MarshalBinary ¶
func (tx *MassTransferV1) MarshalBinary() ([]byte, error)
MarshalBinary saves the transaction to its binary representation.
func (*MassTransferV1) Sign ¶
func (tx *MassTransferV1) Sign(secretKey crypto.SecretKey) error
Sign calculates signature and ID of the transaction.
func (*MassTransferV1) UnmarshalBinary ¶
func (tx *MassTransferV1) UnmarshalBinary(data []byte) error
UnmarshalBinary loads transaction from its binary representation.
func (MassTransferV1) Valid ¶ added in v0.3.0
func (tx MassTransferV1) Valid() (bool, error)
type Message ¶ added in v0.3.0
type Message interface { io.ReaderFrom io.WriterTo encoding.BinaryUnmarshaler encoding.BinaryMarshaler }
func UnmarshalMessage ¶ added in v0.3.0
UnmarshalMessage tries unmarshal bytes to proper type
type MicroBlock ¶ added in v0.3.0
type MicroBlock struct { VersionField byte PrevResBlockSigField crypto.Signature TotalResBlockSigField crypto.Signature TransactionCount uint32 Transactions *TransactionsRepresentation SenderPK crypto.PublicKey Signature crypto.Signature }
func (*MicroBlock) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlock) UnmarshalBinary(b []byte) error
func (*MicroBlock) VerifySignature ¶ added in v0.3.0
func (a *MicroBlock) VerifySignature() (bool, error)
func (*MicroBlock) WriteTo ¶ added in v0.3.0
func (a *MicroBlock) WriteTo(w io.Writer) (int64, error)
func (*MicroBlock) WriteWithoutSignature ¶ added in v0.3.0
func (a *MicroBlock) WriteWithoutSignature(w io.Writer) (int64, error)
type MicroBlockInv ¶ added in v0.3.0
type MicroBlockInv struct { PublicKey crypto.PublicKey TotalBlockSig crypto.Signature PrevBlockSig crypto.Signature Signature crypto.Signature }
func NewUnsignedMicroblockInv ¶ added in v0.3.0
func (*MicroBlockInv) MarshalBinary ¶ added in v0.3.0
func (a *MicroBlockInv) MarshalBinary() ([]byte, error)
func (*MicroBlockInv) Sign ¶ added in v0.3.0
func (a *MicroBlockInv) Sign(key crypto.SecretKey, schema Scheme) error
func (*MicroBlockInv) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlockInv) UnmarshalBinary(data []byte) error
type MicroBlockInvMessage ¶ added in v0.3.0
type MicroBlockInvMessage struct {
Body []byte
}
func (*MicroBlockInvMessage) MarshalBinary ¶ added in v0.3.0
func (a *MicroBlockInvMessage) MarshalBinary() ([]byte, error)
func (*MicroBlockInvMessage) ReadFrom ¶ added in v0.3.0
func (a *MicroBlockInvMessage) ReadFrom(r io.Reader) (n int64, err error)
func (*MicroBlockInvMessage) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlockInvMessage) UnmarshalBinary(data []byte) error
type MicroBlockMessage ¶ added in v0.3.0
CheckPointMessage represents a CheckPoint message
func (*MicroBlockMessage) MarshalBinary ¶ added in v0.3.0
func (a *MicroBlockMessage) MarshalBinary() ([]byte, error)
func (*MicroBlockMessage) ReadFrom ¶ added in v0.3.0
func (*MicroBlockMessage) ReadFrom(r io.Reader) (int64, error)
func (*MicroBlockMessage) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlockMessage) UnmarshalBinary(data []byte) error
type MicroBlockRequest ¶ added in v0.3.0
func (*MicroBlockRequest) MarshalBinary ¶ added in v0.3.0
func (a *MicroBlockRequest) MarshalBinary() ([]byte, error)
func (*MicroBlockRequest) ReadFrom ¶ added in v0.3.0
func (a *MicroBlockRequest) ReadFrom(r io.Reader) (int64, error)
func (*MicroBlockRequest) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlockRequest) UnmarshalBinary(data []byte) error
type MicroBlockRequestMessage ¶ added in v0.3.0
func (*MicroBlockRequestMessage) MarshalBinary ¶ added in v0.3.0
func (a *MicroBlockRequestMessage) MarshalBinary() ([]byte, error)
func (*MicroBlockRequestMessage) ReadFrom ¶ added in v0.3.0
func (a *MicroBlockRequestMessage) ReadFrom(r io.Reader) (n int64, err error)
func (*MicroBlockRequestMessage) UnmarshalBinary ¶ added in v0.3.0
func (a *MicroBlockRequestMessage) UnmarshalBinary(data []byte) error
type MicroblockTotalSig ¶ added in v0.3.0
type NxtConsensus ¶ added in v0.3.0
type OptionalAsset ¶
OptionalAsset represents an optional asset identification
func NewOptionalAssetFromBytes ¶ added in v0.2.0
func NewOptionalAssetFromBytes(b []byte) (*OptionalAsset, error)
func NewOptionalAssetFromDigest ¶ added in v0.2.0
func NewOptionalAssetFromDigest(d crypto.Digest) *OptionalAsset
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) Serialize ¶ added in v0.3.0
func (a OptionalAsset) Serialize(s *serializer.Serializer) error
Serialize into binary representation.
func (OptionalAsset) String ¶
func (a OptionalAsset) String() string
String method converts OptionalAsset to its text representation
func (*OptionalAsset) ToID ¶ added in v0.2.0
func (a *OptionalAsset) ToID() []byte
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 Order ¶
type Order interface { GetID() ([]byte, error) GetVersion() byte GetOrderType() OrderType GetMatcherPK() crypto.PublicKey GetAssetPair() AssetPair GetPrice() uint64 GetExpiration() uint64 Valid() (bool, error) GetAmount() uint64 GetTimestamp() uint64 GetMatcherFee() uint64 GetMatcherFeeAsset() OptionalAsset GetSenderPK() crypto.PublicKey BodyMarshalBinary() ([]byte, error) GetProofs() (*ProofsV1, error) Verify(crypto.PublicKey) (bool, error) }
type OrderBody ¶ added in v0.3.0
type OrderBody struct { 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"` }
func OrderToOrderBody ¶ added in v0.3.0
func (OrderBody) GetSenderPK ¶ added in v0.3.0
func (*OrderBody) ReceiveAmount ¶ added in v0.3.0
func (*OrderBody) Serialize ¶ added in v0.3.0
func (o *OrderBody) Serialize(s *serializer.Serializer) error
func (*OrderBody) SpendAmount ¶ added in v0.3.0
func (*OrderBody) SpendAsset ¶ added in v0.3.0
func (o *OrderBody) SpendAsset() OptionalAsset
type OrderType ¶
type OrderType byte
OrderType an alias for byte that encodes the type of OrderV1 (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 OrderV1 ¶ added in v0.1.2
type OrderV1 struct { ID *crypto.Digest `json:"id,omitempty"` Signature *crypto.Signature `json:"signature,omitempty"` OrderBody }
OrderV1 is an order created and signed by user. Two matched orders builds up an Exchange transaction.
func NewUnsignedOrderV1 ¶ added in v0.1.2
func NewUnsignedOrderV1(senderPK, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64) *OrderV1
NewUnsignedOrderV1 creates the new unsigned order.
func (OrderV1) BodyMarshalBinary ¶ added in v0.3.0
func (OrderV1) BodySerialize ¶ added in v0.3.0
func (o OrderV1) BodySerialize(s *serializer.Serializer) error
func (*OrderV1) GetAssetPair ¶ added in v0.3.0
func (*OrderV1) GetExpiration ¶ added in v0.3.0
func (OrderV1) GetMatcherFee ¶ added in v0.3.0
func (OrderV1) GetMatcherFeeAsset ¶ added in v0.3.0
func (o OrderV1) GetMatcherFeeAsset() OptionalAsset
func (*OrderV1) GetMatcherPK ¶ added in v0.1.2
func (*OrderV1) GetOrderType ¶ added in v0.1.2
func (OrderV1) GetTimestamp ¶ added in v0.3.0
func (*OrderV1) GetVersion ¶ added in v0.1.2
func (*OrderV1) MarshalBinary ¶ added in v0.1.2
MarshalBinary writes order to its bytes representation.
func (*OrderV1) Serialize ¶ added in v0.3.0
func (o *OrderV1) Serialize(s *serializer.Serializer) error
Serialize order to its bytes representation.
func (*OrderV1) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads an order from its binary representation.
type OrderV2 ¶ added in v0.1.2
type OrderV2 struct { Version byte `json:"version"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` OrderBody }
OrderV2 is an order created and signed by user. Two matched orders builds up an Exchange transaction. Version 2 with proofs.
func NewUnsignedOrderV2 ¶ added in v0.1.2
func NewUnsignedOrderV2(senderPK, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64) *OrderV2
NewUnsignedOrderV2 creates the new unsigned order.
func (OrderV2) BodyMarshalBinary ¶ added in v0.3.0
func (*OrderV2) GetAssetPair ¶ added in v0.3.0
func (*OrderV2) GetExpiration ¶ added in v0.3.0
func (OrderV2) GetMatcherFee ¶ added in v0.3.0
func (OrderV2) GetMatcherFeeAsset ¶ added in v0.3.0
func (o OrderV2) GetMatcherFeeAsset() OptionalAsset
func (*OrderV2) GetMatcherPK ¶ added in v0.1.2
func (*OrderV2) GetOrderType ¶ added in v0.1.2
func (OrderV2) GetTimestamp ¶ added in v0.3.0
func (*OrderV2) GetVersion ¶ added in v0.1.2
func (*OrderV2) MarshalBinary ¶ added in v0.1.2
MarshalBinary writes order to its bytes representation.
func (*OrderV2) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads an order from its binary representation.
type OrderV3 ¶ added in v0.3.0
type OrderV3 struct { Version byte `json:"version"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` MatcherFeeAsset OptionalAsset `json:"matcherFeeAssetId"` OrderBody }
OrderV3 is an order that supports matcher's fee in assets.
func NewUnsignedOrderV3 ¶ added in v0.3.0
func NewUnsignedOrderV3(senderPK, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64, matcherFeeAsset OptionalAsset) *OrderV3
NewUnsignedOrderV3 creates the new unsigned order.
func (*OrderV3) BodyMarshalBinary ¶ added in v0.3.0
func (*OrderV3) GetAssetPair ¶ added in v0.3.0
func (*OrderV3) GetExpiration ¶ added in v0.3.0
func (OrderV3) GetMatcherFee ¶ added in v0.3.0
func (OrderV3) GetMatcherFeeAsset ¶ added in v0.3.0
func (o OrderV3) GetMatcherFeeAsset() OptionalAsset
func (*OrderV3) GetMatcherPK ¶ added in v0.3.0
func (*OrderV3) GetOrderType ¶ added in v0.3.0
func (OrderV3) GetTimestamp ¶ added in v0.3.0
func (*OrderV3) GetVersion ¶ added in v0.3.0
func (*OrderV3) MarshalBinary ¶ added in v0.3.0
MarshalBinary writes order to its bytes representation.
func (*OrderV3) UnmarshalBinary ¶ added in v0.3.0
UnmarshalBinary reads an order from its binary representation.
type OrderVersion ¶ added in v0.2.0
type OrderVersion struct {
Version byte `json:"version"`
}
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"` }
Payment transaction is deprecated and can be used only for validation of blockchain.
func NewUnsignedPayment ¶
func NewUnsignedPayment(senderPK crypto.PublicKey, recipient Address, amount, fee, timestamp uint64) *Payment
NewUnsignedPayment creates new Payment transaction with empty Signature and ID fields.
func (*Payment) BodyMarshalBinary ¶ added in v0.3.0
func (*Payment) GenerateID ¶ added in v0.3.0
func (tx *Payment) GenerateID()
func (Payment) GetSenderPK ¶ added in v0.3.0
func (Payment) GetTimestamp ¶ added in v0.3.0
func (Payment) GetTypeVersion ¶ added in v0.3.0
func (tx Payment) GetTypeVersion() TransactionTypeVersion
func (*Payment) MarshalBinary ¶
MarshalBinary returns a bytes representation of Payment transaction.
func (*Payment) MarshalBinary2 ¶ added in v0.3.0
MarshalBinary returns a bytes representation of Payment transaction.
func (*Payment) UnmarshalBinary ¶
UnmarshalBinary reads Payment transaction from its binary representation.
type PeerInfo ¶
PeerInfo represents the address of a single peer
func NewPeerInfoFromString ¶ added in v0.3.0
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) Serialize ¶ added in v0.3.0
func (p *ProofsV1) Serialize(s *serializer.Serializer) error
Serialize proofs to its binary form.
func (*ProofsV1) UnmarshalBinary ¶
UnmarshalBinary reads the proofs from its binary representation.
func (*ProofsV1) UnmarshalJSON ¶
UnmarshalJSON reads the proofs from JSON.
type Recipient ¶ added in v0.2.0
Recipient could be an Alias or an Address.
func NewRecipientFromAddress ¶ added in v0.2.0
NewRecipientFromAddress creates the Recipient from given address.
func NewRecipientFromAlias ¶ added in v0.2.0
NewRecipientFromAlias creates a Recipient with the given Alias inside.
func NewRecipientFromString ¶ added in v0.3.0
func (*Recipient) MarshalBinary ¶ added in v0.2.0
MarshalBinary makes bytes of the Recipient.
func (Recipient) MarshalJSON ¶ added in v0.2.0
MarshalJSON converts the Recipient to its JSON representation.
func (*Recipient) Serialize ¶ added in v0.3.0
func (r *Recipient) Serialize(s *serializer.Serializer) error
func (*Recipient) UnmarshalBinary ¶ added in v0.2.0
UnmarshalBinary reads the Recipient from bytes. Validates the result.
func (*Recipient) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON reads the Recipient from its JSON representation.
type Reissue ¶ added in v0.3.0
type Reissue struct { 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 (Reissue) GetSenderPK ¶ added in v0.3.0
func (Reissue) GetTimestamp ¶ added in v0.3.0
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"` Reissue }
ReissueV1 is a transaction that allows to issue new amount of existing token, if it was issued as reissuable.
func NewUnsignedReissueV1 ¶
func NewUnsignedReissueV1(senderPK crypto.PublicKey, assetID crypto.Digest, quantity uint64, reissuable bool, timestamp, fee uint64) *ReissueV1
NewUnsignedReissueV1 creates new ReissueV1 transaction without signature and ID.
func (*ReissueV1) BodyMarshalBinary ¶ added in v0.3.0
func (*ReissueV1) GenerateID ¶ added in v0.3.0
func (tx *ReissueV1) GenerateID()
func (ReissueV1) GetTypeVersion ¶ added in v0.3.0
func (tx ReissueV1) GetTypeVersion() TransactionTypeVersion
func (*ReissueV1) MarshalBinary ¶
MarshalBinary saves the transaction to its binary representation.
func (*ReissueV1) Sign ¶
Sign use given private key to calculate signature of the transaction. This function also calculates digest of transaction data and assigns it to ID field.
func (*ReissueV1) UnmarshalBinary ¶
UnmarshalBinary reads transaction from its binary representation.
type ReissueV2 ¶ added in v0.1.2
type ReissueV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ChainID byte `json:"-"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` Reissue }
ReissueV2 same as ReissueV1 but version 2 with Proofs.
func NewUnsignedReissueV2 ¶ added in v0.1.2
func NewUnsignedReissueV2(chainID byte, senderPK crypto.PublicKey, assetID crypto.Digest, quantity uint64, reissuable bool, timestamp, fee uint64) *ReissueV2
NewUnsignedReissueV2 creates new ReissueV2 transaction without signature and ID.
func (*ReissueV2) BodyMarshalBinary ¶ added in v0.3.0
func (*ReissueV2) GenerateID ¶ added in v0.3.0
func (tx *ReissueV2) GenerateID()
func (ReissueV2) GetTypeVersion ¶ added in v0.3.0
func (tx ReissueV2) GetTypeVersion() TransactionTypeVersion
func (*ReissueV2) MarshalBinary ¶ added in v0.1.2
MarshalBinary writes ReissueV2 transaction to its bytes representation.
func (*ReissueV2) UnmarshalBinary ¶ added in v0.1.2
UnmarshalBinary reads ReissueV2 from its bytes representation.
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 Script ¶
type Script []byte
func (Script) MarshalJSON ¶ added in v0.2.0
MarshalJSON writes Script as JSON
func (Script) String ¶ added in v0.2.0
String gives a string representation of Script bytes, script bytes encoded as BASE64 with prefix
func (*Script) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON reads Script from it's JSON representation
type ScriptPayment ¶ added in v0.3.0
type ScriptPayment struct { Amount uint64 `json:"amount"` Asset OptionalAsset `json:"assetId"` }
func (ScriptPayment) MarshalBinary ¶ added in v0.3.0
func (p ScriptPayment) MarshalBinary() ([]byte, error)
func (ScriptPayment) Serialize ¶ added in v0.3.0
func (p ScriptPayment) Serialize(s *serializer.Serializer) error
func (*ScriptPayment) UnmarshalBinary ¶ added in v0.3.0
func (p *ScriptPayment) UnmarshalBinary(data []byte) error
type ScriptPayments ¶ added in v0.3.0
type ScriptPayments []ScriptPayment
func (*ScriptPayments) Append ¶ added in v0.3.0
func (sps *ScriptPayments) Append(sp ScriptPayment)
func (ScriptPayments) MarshalBinary ¶ added in v0.3.0
func (sps ScriptPayments) MarshalBinary() ([]byte, error)
func (ScriptPayments) Serialize ¶ added in v0.3.0
func (sps ScriptPayments) Serialize(s *serializer.Serializer) error
func (*ScriptPayments) UnmarshalBinary ¶ added in v0.3.0
func (sps *ScriptPayments) UnmarshalBinary(data []byte) error
type ScriptResult ¶ added in v0.3.0
type ScriptResult struct { Transfers TransferSet Writes WriteSet }
func (*ScriptResult) Valid ¶ added in v0.3.0
func (sr *ScriptResult) Valid() error
type ScriptResultTransfer ¶ added in v0.3.0
type ScriptResultTransfer struct { Recipient Recipient Amount int64 Asset OptionalAsset }
type SetAssetScriptV1 ¶ added in v0.2.0
type SetAssetScriptV1 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"` AssetID crypto.Digest `json:"assetId"` Script Script `json:"script"` Fee uint64 `json:"fee"` Timestamp uint64 `json:"timestamp,omitempty"` }
SetAssetScriptV1 is a transaction to set smart script on an asset.
func NewUnsignedSetAssetScriptV1 ¶ added in v0.2.0
func NewUnsignedSetAssetScriptV1(chain byte, senderPK crypto.PublicKey, assetID crypto.Digest, script []byte, fee, timestamp uint64) *SetAssetScriptV1
NewUnsignedSetAssetScriptV1 creates new unsigned SetAssetScriptV1 transaction.
func (*SetAssetScriptV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *SetAssetScriptV1) BodyMarshalBinary() ([]byte, error)
func (*SetAssetScriptV1) Clone ¶ added in v0.3.0
func (tx *SetAssetScriptV1) Clone() *SetAssetScriptV1
func (*SetAssetScriptV1) GenerateID ¶ added in v0.3.0
func (tx *SetAssetScriptV1) GenerateID()
func (SetAssetScriptV1) GetFee ¶ added in v0.3.0
func (tx SetAssetScriptV1) GetFee() uint64
func (SetAssetScriptV1) GetID ¶ added in v0.2.0
func (tx SetAssetScriptV1) GetID() ([]byte, error)
func (SetAssetScriptV1) GetSenderPK ¶ added in v0.3.0
func (tx SetAssetScriptV1) GetSenderPK() crypto.PublicKey
func (SetAssetScriptV1) GetTimestamp ¶ added in v0.3.0
func (tx SetAssetScriptV1) GetTimestamp() uint64
func (SetAssetScriptV1) GetTypeVersion ¶ added in v0.3.0
func (tx SetAssetScriptV1) GetTypeVersion() TransactionTypeVersion
func (*SetAssetScriptV1) MarshalBinary ¶ added in v0.2.0
func (tx *SetAssetScriptV1) MarshalBinary() ([]byte, error)
MarshalBinary writes SetAssetScriptV1 transaction to its bytes representation.
func (*SetAssetScriptV1) NonEmptyScript ¶ added in v0.2.0
func (tx *SetAssetScriptV1) NonEmptyScript() bool
NonEmptyScript returns true if transaction contains non-empty script.
func (*SetAssetScriptV1) Sign ¶ added in v0.2.0
func (tx *SetAssetScriptV1) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*SetAssetScriptV1) UnmarshalBinary ¶ added in v0.2.0
func (tx *SetAssetScriptV1) UnmarshalBinary(data []byte) error
UnmarshalBinary reads SetAssetScriptV1 transaction from its binary representation.
func (SetAssetScriptV1) Valid ¶ added in v0.3.0
func (tx SetAssetScriptV1) Valid() (bool, error)
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 Script `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
NewUnsignedSetScriptV1 creates new unsigned SetScriptV1 transaction.
func (*SetScriptV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *SetScriptV1) BodyMarshalBinary() ([]byte, error)
func (*SetScriptV1) GenerateID ¶ added in v0.3.0
func (tx *SetScriptV1) GenerateID()
func (SetScriptV1) GetFee ¶ added in v0.3.0
func (tx SetScriptV1) GetFee() uint64
func (SetScriptV1) GetID ¶ added in v0.2.0
func (tx SetScriptV1) GetID() ([]byte, error)
func (SetScriptV1) GetSenderPK ¶ added in v0.3.0
func (tx SetScriptV1) GetSenderPK() crypto.PublicKey
func (SetScriptV1) GetTimestamp ¶ added in v0.3.0
func (tx SetScriptV1) GetTimestamp() uint64
func (SetScriptV1) GetTypeVersion ¶ added in v0.3.0
func (tx SetScriptV1) GetTypeVersion() TransactionTypeVersion
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.
func (SetScriptV1) Valid ¶ added in v0.3.0
func (tx SetScriptV1) Valid() (bool, error)
type SignaturesMessage ¶
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
NewUnsignedSponsorshipV1 creates new unsigned SponsorshipV1 transaction
func (*SponsorshipV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *SponsorshipV1) BodyMarshalBinary() ([]byte, error)
func (*SponsorshipV1) Clone ¶ added in v0.3.0
func (tx *SponsorshipV1) Clone() *SponsorshipV1
func (*SponsorshipV1) GenerateID ¶ added in v0.3.0
func (tx *SponsorshipV1) GenerateID()
func (SponsorshipV1) GetFee ¶ added in v0.3.0
func (tx SponsorshipV1) GetFee() uint64
func (SponsorshipV1) GetID ¶ added in v0.2.0
func (tx SponsorshipV1) GetID() ([]byte, error)
func (SponsorshipV1) GetSenderPK ¶ added in v0.3.0
func (tx SponsorshipV1) GetSenderPK() crypto.PublicKey
func (SponsorshipV1) GetTimestamp ¶ added in v0.3.0
func (tx SponsorshipV1) GetTimestamp() uint64
func (SponsorshipV1) GetTypeVersion ¶ added in v0.3.0
func (tx SponsorshipV1) GetTypeVersion() TransactionTypeVersion
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.
func (SponsorshipV1) Valid ¶ added in v0.3.0
func (tx SponsorshipV1) Valid() (bool, error)
type StringArgument ¶ added in v0.3.0
type StringArgument struct {
Value string
}
StringArgument structure is an argument that store a string value.
func NewStringArgument ¶ added in v0.3.0
func NewStringArgument(s string) *StringArgument
func (StringArgument) GetValueType ¶ added in v0.3.0
func (a StringArgument) GetValueType() ArgumentValueType
GetValueType returns the type of value of the argument.
func (StringArgument) MarshalBinary ¶ added in v0.3.0
func (a StringArgument) MarshalBinary() ([]byte, error)
MarshalBinary converts the argument to its byte representation.
func (StringArgument) MarshalJSON ¶ added in v0.3.0
func (a StringArgument) MarshalJSON() ([]byte, error)
MarshalJSON writes the entry to its JSON representation.
func (StringArgument) Serialize ¶ added in v0.3.0
func (a StringArgument) Serialize(s *serializer.Serializer) error
Serialize argument to its byte representation.
func (*StringArgument) UnmarshalBinary ¶ added in v0.3.0
func (a *StringArgument) UnmarshalBinary(data []byte) error
UnmarshalBinary reads an StringArgument structure from bytes.
func (*StringArgument) UnmarshalJSON ¶ added in v0.3.0
func (a *StringArgument) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from JSON.
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() DataValueType
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) MarshalValue ¶ added in v0.3.0
func (e StringDataEntry) MarshalValue() ([]byte, error)
MarshalValue converts the data entry value to its byte representation.
func (*StringDataEntry) SetKey ¶ added in v0.3.0
func (e *StringDataEntry) SetKey(key string)
SetKey sets the key of data entry.
func (*StringDataEntry) UnmarshalBinary ¶
func (e *StringDataEntry) UnmarshalBinary(data []byte) error
UnmarshalBinary reads StringDataEntry structure from bytes.
func (*StringDataEntry) UnmarshalJSON ¶
func (e *StringDataEntry) UnmarshalJSON(value []byte) error
UnmarshalJSON reads the entry from JSON.
func (*StringDataEntry) UnmarshalValue ¶ added in v0.3.0
func (e *StringDataEntry) UnmarshalValue(data []byte) error
UnmarshalValue reads StringDataEntry value from bytes.
func (StringDataEntry) Valid ¶ added in v0.3.0
func (e StringDataEntry) Valid() (bool, error)
type TCPAddr ¶ added in v0.3.0
func NewTCPAddrFromString ¶ added in v0.3.0
type Transaction ¶ added in v0.1.2
type Transaction interface { GetTypeVersion() TransactionTypeVersion GetID() ([]byte, error) GetSenderPK() crypto.PublicKey Valid() (bool, error) MarshalBinary() ([]byte, error) UnmarshalBinary([]byte) error GetFee() uint64 GetTimestamp() uint64 GenerateID() }
Transaction is a set of common transaction functions.
func BytesToTransaction ¶ added in v0.2.0
func BytesToTransaction(tx []byte) (Transaction, error)
func BytesToTransactions ¶ added in v0.3.0
func BytesToTransactions(count int, txs []byte) ([]Transaction, error)
func GuessTransactionType ¶ added in v0.3.0
func GuessTransactionType(t *TransactionTypeVersion) (Transaction, error)
Guess transaction from type and version
type TransactionMessage ¶
type TransactionMessage struct {
Transaction []byte
}
TransactionMessage represents TransactionsSend 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
TransactionType
const ( GenesisTransaction TransactionType = iota + 1 // 1 - Genesis transaction PaymentTransaction // 2 - Payment transaction IssueTransaction // 3 - Issue transaction TransferTransaction // 4 - Transfer transaction ReissueTransaction // 5 - Reissue transaction BurnTransaction // 6 - Burn transaction ExchangeTransaction // 7 - Exchange transaction LeaseTransaction // 8 - Lease transaction LeaseCancelTransaction // 9 - LeaseCancel transaction CreateAliasTransaction // 10 - CreateAlias transaction MassTransferTransaction // 11 - MassTransfer transaction DataTransaction // 12 - Data transaction SetScriptTransaction // 13 - SetScript transaction SponsorshipTransaction // 14 - Sponsorship transaction SetAssetScriptTransaction // 15 - SetAssetScript transaction InvokeScriptTransaction // 16 - InvokeScript transaction )
All transaction types supported.
type TransactionTypeVersion ¶ added in v0.3.0
type TransactionTypeVersion struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` }
type Transactions ¶ added in v0.3.0
type Transactions []Transaction
func (Transactions) Count ¶ added in v0.3.0
func (a Transactions) Count() int
type TransactionsRepresentation ¶ added in v0.3.0
type TransactionsRepresentation struct {
// contains filtered or unexported fields
}
func NewReprFromBytes ¶ added in v0.3.0
func NewReprFromBytes(b []byte, count int) *TransactionsRepresentation
func NewReprFromTransactions ¶ added in v0.3.0
func NewReprFromTransactions(t Transactions) *TransactionsRepresentation
func (*TransactionsRepresentation) Bytes ¶ added in v0.3.0
func (a *TransactionsRepresentation) Bytes() ([]byte, error)
func (*TransactionsRepresentation) BytesUnchecked ¶ added in v0.3.0
func (a *TransactionsRepresentation) BytesUnchecked() []byte
func (*TransactionsRepresentation) Count ¶ added in v0.3.0
func (a *TransactionsRepresentation) Count() int
func (TransactionsRepresentation) Join ¶ added in v0.3.0
func (a TransactionsRepresentation) Join(other *TransactionsRepresentation) (*TransactionsRepresentation, error)
func (TransactionsRepresentation) MarshalJSON ¶ added in v0.3.0
func (a TransactionsRepresentation) MarshalJSON() ([]byte, error)
func (*TransactionsRepresentation) Transactions ¶ added in v0.3.0
func (a *TransactionsRepresentation) Transactions() (Transactions, error)
func (*TransactionsRepresentation) UnmarshalJSON ¶ added in v0.3.0
func (a *TransactionsRepresentation) UnmarshalJSON(data []byte) error
type Transfer ¶ added in v0.3.0
type Transfer struct { 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 Recipient `json:"recipient"` Attachment Attachment `json:"attachment,omitempty"` }
func (Transfer) GetSenderPK ¶ added in v0.3.0
func (Transfer) GetTimestamp ¶ added in v0.3.0
func (*Transfer) Serialize ¶ added in v0.3.0
func (tr *Transfer) Serialize(s *serializer.Serializer) error
type TransferSet ¶ added in v0.3.0
type TransferSet []ScriptResultTransfer
func (*TransferSet) Valid ¶ added in v0.3.0
func (ts *TransferSet) Valid() error
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"` Transfer }
TransferV1 transaction to transfer any token from one account to another. Version 1.
func NewUnsignedTransferV1 ¶
func NewUnsignedTransferV1(senderPK crypto.PublicKey, amountAsset, feeAsset OptionalAsset, timestamp, amount, fee uint64, recipient Recipient, attachment string) *TransferV1
NewUnsignedTransferV1 creates new TransferV1 transaction without signature and ID.
func (*TransferV1) BodyMarshalBinary ¶ added in v0.3.0
func (tx *TransferV1) BodyMarshalBinary() ([]byte, error)
func (*TransferV1) BodySerialize ¶ added in v0.3.0
func (tx *TransferV1) BodySerialize(s *serializer.Serializer) error
func (*TransferV1) Clone ¶ added in v0.3.0
func (tx *TransferV1) Clone() *TransferV1
func (*TransferV1) GenerateID ¶ added in v0.3.0
func (tx *TransferV1) GenerateID()
func (TransferV1) GetID ¶ added in v0.2.0
func (tx TransferV1) GetID() ([]byte, error)
func (TransferV1) GetTypeVersion ¶ added in v0.3.0
func (tx TransferV1) GetTypeVersion() TransactionTypeVersion
func (*TransferV1) MarshalBinary ¶
func (tx *TransferV1) MarshalBinary() ([]byte, error)
MarshalBinary saves transaction to its binary representation.
func (*TransferV1) Serialize ¶ added in v0.3.0
func (tx *TransferV1) Serialize(s *serializer.Serializer) error
func (*TransferV1) Sign ¶
func (tx *TransferV1) Sign(secretKey crypto.SecretKey) error
Sign calculates a signature and a digest as an ID of the transaction.
func (*TransferV1) UnmarshalBinary ¶
func (tx *TransferV1) UnmarshalBinary(data []byte) error
UnmarshalBinary reads transaction from its binary representation.
type TransferV2 ¶ added in v0.1.2
type TransferV2 struct { Type TransactionType `json:"type"` Version byte `json:"version,omitempty"` ID *crypto.Digest `json:"id,omitempty"` Proofs *ProofsV1 `json:"proofs,omitempty"` Transfer }
TransferV2 transaction to transfer any token from one account to another. Version 2.
func NewUnsignedTransferV2 ¶ added in v0.1.2
func NewUnsignedTransferV2(senderPK crypto.PublicKey, amountAsset, feeAsset OptionalAsset, timestamp, amount, fee uint64, recipient Recipient, attachment string) *TransferV2
NewUnsignedTransferV2 creates new TransferV2 transaction without proofs and ID.
func (*TransferV2) BodyMarshalBinary ¶ added in v0.2.0
func (tx *TransferV2) BodyMarshalBinary() ([]byte, error)
func (*TransferV2) BodySerialize ¶ added in v0.3.0
func (tx *TransferV2) BodySerialize(s *serializer.Serializer) error
func (*TransferV2) BodyUnmarshalBinary ¶ added in v0.2.0
func (tx *TransferV2) BodyUnmarshalBinary(data []byte) error
func (*TransferV2) Clone ¶ added in v0.3.0
func (tx *TransferV2) Clone() *TransferV2
func (*TransferV2) GenerateID ¶ added in v0.3.0
func (tx *TransferV2) GenerateID()
func (TransferV2) GetID ¶ added in v0.2.0
func (tx TransferV2) GetID() ([]byte, error)
func (TransferV2) GetTypeVersion ¶ added in v0.3.0
func (tx TransferV2) GetTypeVersion() TransactionTypeVersion
func (*TransferV2) MarshalBinary ¶ added in v0.1.2
func (tx *TransferV2) MarshalBinary() ([]byte, error)
MarshalBinary writes TransferV2 transaction to its bytes representation.
func (*TransferV2) Serialize ¶ added in v0.3.0
func (tx *TransferV2) Serialize(s *serializer.Serializer) error
func (*TransferV2) Sign ¶ added in v0.1.2
func (tx *TransferV2) Sign(secretKey crypto.SecretKey) error
Sign adds signature as a proof at first position.
func (*TransferV2) UnmarshalBinary ¶ added in v0.1.2
func (tx *TransferV2) UnmarshalBinary(data []byte) error
UnmarshalBinary reads TransferV2 from its bytes representation.
func (TransferV2) Valid ¶ added in v0.3.0
func (tx TransferV2) Valid() (bool, error)
type U8String ¶ added in v0.3.0
type U8String struct {
S string
}
func NewU8String ¶ added in v0.3.0
func (U8String) MarshalBinary ¶ added in v0.3.0
MarshalBinary encodes U8String to binary form
type Version ¶
type Version struct {
Major, Minor, Patch uint32
}
Version represents the version of the protocol
func NewVersionFromString ¶ added in v0.3.0
func (*Version) MarshalJSON ¶ added in v0.3.0
type WrapWriteTo ¶ added in v0.3.0
type WrapWriteTo struct {
// contains filtered or unexported fields
}