proto

package
v0.8.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 29 Imported by: 38

Documentation

Index

Constants

View Source
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'
)
View Source
const (
	MicroBlockInvSizeSig  = crypto.PublicKeySize + crypto.SignatureSize*3
	MicroBlockInvSizeHash = crypto.PublicKeySize + crypto.DigestSize*2 + crypto.SignatureSize
)
View Source
const (
	MaxHeaderLength = 17

	HeaderSizeWithPayload    = 17
	HeaderSizeWithoutPayload = 13
)
View Source
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
	ContentIDPBBlock           = 29
	ContentIDPBMicroBlock      = 30
	ContentIDPBTransaction     = 31
	ContentIDGetBlockIds       = 32
	ContentIDBlockIds          = 33

	HeaderContentIDPosition = 8
)

Constants for message IDs

View Source
const (

	// Max allowed versions of transactions.
	MaxGenesisTransactionVersion         = 2
	MaxPaymentTransactionVersion         = 2
	MaxTransferTransactionVersion        = 3
	MaxIssueTransactionVersion           = 3
	MaxReissueTransactionVersion         = 3
	MaxBurnTransactionVersion            = 3
	MaxExchangeTransactionVersion        = 3
	MaxLeaseTransactionVersion           = 3
	MaxLeaseCancelTransactionVersion     = 3
	MaxCreateAliasTransactionVersion     = 3
	MaxMassTransferTransactionVersion    = 2
	MaxDataTransactionVersion            = 2
	MaxSetScriptTransactionVersion       = 2
	MaxSponsorshipTransactionVersion     = 2
	MaxSetAssetScriptTransactionVersion  = 2
	MaxInvokeScriptTransactionVersion    = 2
	MaxUpdateAssetInfoTransactionVersion = 1

	MinFee = 100_000
)
View Source
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)
)
View Source
const (
	ArgumentInteger    = ArgumentValueType(0)  // E_LONG
	ArgumentBinary     = ArgumentValueType(1)  // E_BYTES
	ArgumentString     = ArgumentValueType(2)  // E_STRING
	ArgumentBoolean    = ArgumentValueType(99) // Nonexistent RIDE type is used
	ArgumentValueTrue  = ArgumentValueType(6)  // E_TRUE
	ArgumentValueFalse = ArgumentValueType(7)  // E_FALSE
	ArgumentList       = ArgumentValueType(11) // E_LIST
)
View Source
const IpPortLength = net.IPv6len + 8

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func AppendHeaderBytesToTransactions added in v0.3.0

func AppendHeaderBytesToTransactions(headerBytes, transactions []byte) ([]byte, error)

func BlockEncodeJson added in v0.3.0

func BlockEncodeJson(b *Block) ([]byte, error)

func BlockGetParent added in v0.3.0

func BlockGetParent(data []byte) (crypto.Signature, error)

BlockGetParent get parent signature from block without deserialization

func BlockGetSignature added in v0.3.0

func BlockGetSignature(data []byte) (crypto.Signature, error)

BlockGetSignature get signature from block without deserialization

func Bool

func Bool(buf []byte) (bool, error)

func BytesWithUInt16Len

func BytesWithUInt16Len(buf []byte) ([]byte, error)

BytesWithUInt16Len reads from buf an array of bytes of length encoded in first 2 bytes.

func BytesWithUInt32Len added in v0.3.0

func BytesWithUInt32Len(buf []byte) ([]byte, error)

BytesWithUInt32Len reads from buf an array of bytes of length encoded in first 4 bytes.

func GenerateIssueScriptActionID added in v0.5.0

func GenerateIssueScriptActionID(name, description string, decimals, quantity int64, reissuable bool, nonce int64, txID crypto.Digest) crypto.Digest

GenerateIssueScriptActionID implements ID generation used in RIDE to create new ID of Issue.

func Int64ToProtobuf added in v0.5.0

func Int64ToProtobuf(val int64) ([]byte, error)

func IsProtobufTx added in v0.5.0

func IsProtobufTx(tx Transaction) bool

func MarshalOrderBody added in v0.5.0

func MarshalOrderBody(scheme Scheme, o Order) ([]byte, error)

func MarshalSignedTxDeterministic added in v0.5.0

func MarshalSignedTxDeterministic(tx Transaction, scheme Scheme) ([]byte, error)

func MarshalToProtobufDeterministic added in v0.5.0

func MarshalToProtobufDeterministic(pb protobuf.Message) ([]byte, error)

func MarshalTx added in v0.5.0

func MarshalTx(scheme Scheme, tx Transaction) ([]byte, error)

func MarshalTxBody added in v0.5.0

func MarshalTxBody(scheme Scheme, tx Transaction) ([]byte, error)

func MarshalTxDeterministic added in v0.5.0

func MarshalTxDeterministic(tx Transaction, scheme Scheme) ([]byte, error)

func NetworkStrFromScheme added in v0.5.0

func NetworkStrFromScheme(scheme Scheme) string

func NewInfoMsg added in v0.8.8

func NewInfoMsg(err error) error

func NewTimestampFromTime added in v0.3.0

func NewTimestampFromTime(t time.Time) uint64

func NewTimestampFromUSeconds added in v0.5.0

func NewTimestampFromUSeconds(seconds uint64) uint64

func NewTimestampFromUnixNano added in v0.3.0

func NewTimestampFromUnixNano(nano int64) uint64

func PutBool

func PutBool(buf []byte, b bool)

func PutBytesWithUInt16Len

func PutBytesWithUInt16Len(buf []byte, data []byte)

PutBytesWithUInt16Len prepends given buf with 2 bytes of it's length.

func PutBytesWithUInt32Len added in v0.3.0

func PutBytesWithUInt32Len(buf []byte, data []byte)

PutBytesWithUInt32Len prepends given buf with 4 bytes of it's length.

func PutStringWithUInt16Len

func PutStringWithUInt16Len(buf []byte, s string)

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

func PutStringWithUInt32Len(buf []byte, s string)

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

func PutStringWithUInt8Len(buf []byte, s string)

PutStringWithUInt8Len converts the string to slice of bytes. The first byte of resulting slice contains the length of the string.

func ReadPayload added in v0.3.0

func ReadPayload(buf []byte, r io.Reader) (int64, error)

func StringWithUInt16Len

func StringWithUInt16Len(buf []byte) (string, error)

StringWithUInt16Len reads a string from the buffer `buf`.

func StringWithUInt32Len added in v0.3.0

func StringWithUInt32Len(buf []byte) (string, error)

StringWithUInt32Len reads a string from the buffer `buf`.

func StringWithUInt8Len added in v0.3.0

func StringWithUInt8Len(buf []byte) (string, error)

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.

func TransactionToProtobufCommon added in v0.5.0

func TransactionToProtobufCommon(scheme Scheme, tx Transaction) *g.Transaction

TransactionToProtobufCommon() converts to protobuf structure with fields that are common for all of the transaction types.

func TxVersionFromJson added in v0.5.0

func TxVersionFromJson(data []byte) (byte, error)

func ValidateActions added in v0.5.0

func ValidateActions(actions []ScriptAction, restrictions ActionsValidationRestrictions) error

func ValidateNonNegativeAmount added in v0.8.0

func ValidateNonNegativeAmount(amount int64, of string) error

func ValidatePositiveAmount added in v0.8.0

func ValidatePositiveAmount(amount int64, of string) error

func VersionFromScriptBytes added in v0.5.0

func VersionFromScriptBytes(scriptBytes []byte) (int32, error)

Types

type ActionsValidationRestrictions added in v0.5.0

type ActionsValidationRestrictions struct {
	DisableSelfTransfers     bool
	ScriptAddress            Address
	KeySizeValidationVersion byte
}

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 MustAddressFromPublicKey(scheme byte, publicKey crypto.PublicKey) Address

func MustAddressFromString added in v0.8.0

func MustAddressFromString(s string) Address

func NewAddressFromBytes

func NewAddressFromBytes(b []byte) (Address, error)

NewAddressFromBytes creates an Address from the slice of bytes and checks that the result address is valid address.

func NewAddressFromPublicKey

func NewAddressFromPublicKey(scheme byte, publicKey crypto.PublicKey) (Address, error)

NewAddressFromPublicKey produces an Address from given scheme and Public Key bytes.

func NewAddressFromString

func NewAddressFromString(s string) (Address, error)

NewAddressFromString creates an Address from its string representation. This function checks that the address is valid.

func NewAddressLikeFromAnyBytes added in v0.3.0

func NewAddressLikeFromAnyBytes(scheme byte, b []byte) (Address, error)

NewAddressFromPublicKey produces an Address from given scheme and Public Key bytes.

func RebuildAddress added in v0.3.0

func RebuildAddress(scheme byte, body []byte) (Address, error)

func (Address) Body added in v0.5.0

func (a Address) Body() []byte

func (Address) Bytes added in v0.2.0

func (a Address) Bytes() []byte

Bytes converts the fixed-length byte array of the Address to a slice of bytes.

func (*Address) Eq added in v0.5.0

func (a *Address) Eq(b Address) bool

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

MarshalJSON is the custom JSON marshal function for the Address.

func (Address) String

func (a Address) String() string

String produces the BASE58 string representation of the Address.

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(value []byte) error

UnmarshalJSON tries to unmarshal an Address from it's JSON representation. This method does not perform validation of the result address.

func (*Address) Valid added in v0.3.0

func (a *Address) Valid() (bool, error)

Valid checks that version and checksum of the Address are correct.

type Alias

type Alias struct {
	Version byte
	Scheme  byte
	Alias   string
}

Alias represents the nickname tha could be attached to the Address.

func NewAlias

func NewAlias(scheme byte, alias string) *Alias

func NewAliasFromBytes

func NewAliasFromBytes(b []byte) (*Alias, error)

NewAliasFromBytes unmarshal an Alias from bytes and checks that it's valid.

func NewAliasFromString

func NewAliasFromString(s string) (*Alias, error)

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) BinarySize added in v0.5.0

func (a Alias) BinarySize() int

func (*Alias) Bytes added in v0.2.0

func (a *Alias) Bytes() []byte

Bytes converts the Alias to the slice of bytes.

func (*Alias) MarshalBinary

func (a *Alias) MarshalBinary() ([]byte, error)

MarshalBinary converts the Alias to the slice of bytes. Just calls Bytes().

func (Alias) MarshalJSON

func (a Alias) MarshalJSON() ([]byte, error)

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) String

func (a Alias) String() string

String converts the Alias to its 3-part string representation.

func (*Alias) UnmarshalBinary

func (a *Alias) UnmarshalBinary(data []byte) error

Reads an Alias from its bytes representation. This function does not validate the result.

func (*Alias) UnmarshalJSON

func (a *Alias) UnmarshalJSON(value []byte) error

UnmarshalJSON reads an Alias from JSON.

func (Alias) Valid added in v0.3.0

func (a Alias) Valid() (bool, error)

Valid validates the Alias checking it length, version and symbols.

func (*Alias) WriteTo added in v0.3.0

func (a *Alias) WriteTo(w io.Writer) (int64, error)

type Argument added in v0.3.0

type Argument interface {
	GetValueType() ArgumentValueType
	MarshalBinary() ([]byte, error)
	BinarySize() int
	Serialize(*serializer.Serializer) error
}

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.

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) Append added in v0.3.0

func (a *Arguments) Append(arg Argument)

Append adds an argument to the Arguments list.

func (Arguments) BinarySize added in v0.5.0

func (a Arguments) BinarySize() int

func (Arguments) MarshalBinary added in v0.3.0

func (a Arguments) MarshalBinary() ([]byte, error)

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 (a *Arguments) UnmarshalBinary(data []byte) error

func (*Arguments) UnmarshalJSON added in v0.3.0

func (a *Arguments) UnmarshalJSON(data []byte) error

UnmarshalJSON custom JSON deserialization method.

type AssetInfo added in v0.3.0

type AssetInfo struct {
	ID              crypto.Digest
	Quantity        uint64
	Decimals        byte
	Issuer          Address
	IssuerPublicKey crypto.PublicKey
	Reissuable      bool
	Scripted        bool
	Sponsored       bool
}

func (*AssetInfo) ToProtobuf added in v0.5.0

func (ai *AssetInfo) ToProtobuf() *g.AssetInfoResponse

type AssetPair

type AssetPair struct {
	AmountAsset OptionalAsset `json:"amountAsset"`
	PriceAsset  OptionalAsset `json:"priceAsset"`
}

AssetPair is a pair of assets in ExchangeTransaction.

func (AssetPair) BinarySize added in v0.5.0

func (p AssetPair) BinarySize() int

func (AssetPair) ToProtobuf added in v0.5.0

func (p AssetPair) ToProtobuf() *g.AssetPair

type Attachment

type Attachment []byte

func NewAttachmentFromBase58 added in v0.1.2

func NewAttachmentFromBase58(s string) (Attachment, error)

func (Attachment) Bytes added in v0.3.0

func (a Attachment) Bytes() ([]byte, error)

func (Attachment) MarshalJSON

func (a Attachment) MarshalJSON() ([]byte, error)

func (Attachment) Size added in v0.5.0

func (a Attachment) Size() int

func (*Attachment) UnmarshalJSON

func (a *Attachment) UnmarshalJSON(data []byte) error

type B58Bytes

type B58Bytes []byte

B58Bytes represents bytes as Base58 string in JSON

func (B58Bytes) Bytes added in v0.2.0

func (b B58Bytes) Bytes() []byte

func (B58Bytes) MarshalJSON

func (b B58Bytes) MarshalJSON() ([]byte, error)

MarshalJSON writes B58Bytes Value as JSON string

func (B58Bytes) String

func (b B58Bytes) String() string

String represents underlying bytes as Base58 string

func (*B58Bytes) UnmarshalJSON

func (b *B58Bytes) UnmarshalJSON(value []byte) error

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) BinarySize added in v0.5.0

func (a BinaryArgument) BinarySize() int

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

type BinaryDataEntry struct {
	Key   string
	Value []byte
}

BinaryDataEntry represents a key-value data entry that stores binary value.

func (BinaryDataEntry) BinarySize added in v0.5.0

func (e BinaryDataEntry) BinarySize() int

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) ToProtobuf added in v0.5.0

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(version byte) error

type Block added in v0.2.0

type Block struct {
	BlockHeader
	Transactions Transactions `json:"transactions,omitempty"`
}

Block is a block of the blockchain

func CreateBlock added in v0.3.0

func CreateBlock(transactions Transactions, timestamp Timestamp, parentID BlockID, publicKey crypto.PublicKey, nxtConsensus NxtConsensus, version BlockVersion, features []int16, rewardVote int64, scheme Scheme) (*Block, error)

func (*Block) Clone added in v0.5.0

func (b *Block) Clone() *Block

func (*Block) Marshal added in v0.5.0

func (b *Block) Marshal(scheme Scheme) ([]byte, error)

func (*Block) MarshalBinary added in v0.2.0

func (b *Block) MarshalBinary() ([]byte, error)

MarshalBinary encodes Block to binary form

func (*Block) MarshalToProtobuf added in v0.5.0

func (b *Block) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*Block) Marshaller added in v0.7.0

func (b *Block) Marshaller() Marshaller

func (*Block) SetTransactionsRoot added in v0.5.0

func (b *Block) SetTransactionsRoot(scheme Scheme) error

func (*Block) SetTransactionsRootIfPossible added in v0.6.0

func (b *Block) SetTransactionsRootIfPossible(scheme Scheme) error

func (*Block) Sign added in v0.3.0

func (b *Block) Sign(scheme Scheme, secret crypto.SecretKey) error

func (*Block) ToProtobuf added in v0.5.0

func (b *Block) ToProtobuf(scheme Scheme) (*g.Block, error)

func (*Block) ToProtobufWithHeight added in v0.5.0

func (b *Block) ToProtobufWithHeight(currentScheme Scheme, height uint64) (*pb.BlockWithHeight, error)

func (*Block) UnmarshalBinary added in v0.2.0

func (b *Block) UnmarshalBinary(data []byte, scheme Scheme) (err error)

UnmarshalBinary decodes Block from binary form

func (*Block) UnmarshalFromProtobuf added in v0.5.0

func (b *Block) UnmarshalFromProtobuf(data []byte) error

func (*Block) VerifySignature added in v0.3.0

func (b *Block) VerifySignature(scheme Scheme) (bool, error)

func (*Block) VerifyTransactionsRoot added in v0.5.0

func (b *Block) VerifyTransactionsRoot(scheme Scheme) (bool, error)

func (*Block) WriteTo added in v0.3.0

func (b *Block) WriteTo(w io.Writer) (int64, error)

func (*Block) WriteToWithoutSignature added in v0.3.0

func (b *Block) WriteToWithoutSignature(w io.Writer) (int64, error)

WriteToWithoutSignature writes binary representation of block into Writer. It does not sign and write signature.

type BlockHeader added in v0.2.0

type BlockHeader struct {
	Version                BlockVersion `json:"version"`
	Timestamp              uint64       `json:"timestamp"`
	Parent                 BlockID      `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:"genPublicKey"`
	BlockSignature         crypto.Signature `json:"signature"`
	TransactionsRoot       B58Bytes         `json:"transactionsRoot,omitempty"`

	ID     BlockID `json:"id"`
	Height uint64  `json:"height"`
}

Block info (except transactions)

func (*BlockHeader) BlockID added in v0.5.0

func (b *BlockHeader) BlockID() BlockID

func (*BlockHeader) GenerateBlockID added in v0.5.0

func (b *BlockHeader) GenerateBlockID(scheme Scheme) error

func (*BlockHeader) HeaderToProtobuf added in v0.5.0

func (b *BlockHeader) HeaderToProtobuf(scheme Scheme) (*g.Block, error)

func (*BlockHeader) HeaderToProtobufHeader added in v0.5.0

func (b *BlockHeader) HeaderToProtobufHeader(scheme Scheme) (*g.Block_Header, error)

func (*BlockHeader) HeaderToProtobufWithHeight added in v0.5.0

func (b *BlockHeader) HeaderToProtobufWithHeight(currentScheme Scheme, height uint64) (*pb.BlockWithHeight, error)

func (*BlockHeader) MarshalHeader added in v0.5.0

func (b *BlockHeader) MarshalHeader(scheme Scheme) ([]byte, error)

func (*BlockHeader) MarshalHeaderToBinary added in v0.2.0

func (b *BlockHeader) MarshalHeaderToBinary() ([]byte, error)

func (*BlockHeader) MarshalHeaderToProtobuf added in v0.5.0

func (b *BlockHeader) MarshalHeaderToProtobuf(scheme Scheme) ([]byte, error)

func (*BlockHeader) MarshalHeaderToProtobufWithoutSignature added in v0.5.0

func (b *BlockHeader) MarshalHeaderToProtobufWithoutSignature(scheme Scheme) ([]byte, error)

func (*BlockHeader) UnmarshalHeaderFromBinary added in v0.2.0

func (b *BlockHeader) UnmarshalHeaderFromBinary(data []byte, scheme Scheme) (err error)

type BlockID

type BlockID struct {
	// contains filtered or unexported fields
}

func MustBlockIDFromBase58 added in v0.8.0

func MustBlockIDFromBase58(s string) BlockID

func NewBlockIDFromBase58 added in v0.5.0

func NewBlockIDFromBase58(s string) (BlockID, error)

func NewBlockIDFromBytes added in v0.5.0

func NewBlockIDFromBytes(data []byte) (BlockID, error)

func NewBlockIDFromDigest added in v0.5.0

func NewBlockIDFromDigest(dig crypto.Digest) BlockID

func NewBlockIDFromSignature added in v0.5.0

func NewBlockIDFromSignature(sig crypto.Signature) BlockID

func (BlockID) Bytes added in v0.5.0

func (id BlockID) Bytes() []byte

func (BlockID) IsSignature added in v0.5.0

func (id BlockID) IsSignature() bool

func (BlockID) IsValid added in v0.5.0

func (id BlockID) IsValid(version BlockVersion) bool

func (BlockID) MarshalJSON added in v0.5.0

func (id BlockID) MarshalJSON() ([]byte, error)

func (BlockID) ShortString added in v0.5.0

func (id BlockID) ShortString() string

func (BlockID) Signature added in v0.5.0

func (id BlockID) Signature() crypto.Signature

func (BlockID) String added in v0.5.0

func (id BlockID) String() string

func (*BlockID) UnmarshalJSON added in v0.5.0

func (id *BlockID) UnmarshalJSON(value []byte) error

type BlockIDType added in v0.5.0

type BlockIDType byte
const (
	SignatureID BlockIDType = iota
	DigestID
)

type BlockIdsMessage added in v0.5.0

type BlockIdsMessage struct {
	Blocks []BlockID
}

BlockIdsMessage is used for Signatures or hashes block ids.

func (*BlockIdsMessage) MarshalBinary added in v0.5.0

func (m *BlockIdsMessage) MarshalBinary() ([]byte, error)

func (*BlockIdsMessage) ReadFrom added in v0.5.0

func (m *BlockIdsMessage) ReadFrom(r io.Reader) (int64, error)

func (*BlockIdsMessage) UnmarshalBinary added in v0.5.0

func (m *BlockIdsMessage) UnmarshalBinary(data []byte) error

func (*BlockIdsMessage) WriteTo added in v0.5.0

func (m *BlockIdsMessage) WriteTo(w io.Writer) (int64, error)

type BlockInfo added in v0.3.0

type BlockInfo struct {
	Timestamp           uint64
	Height              uint64
	BaseTarget          uint64
	GenerationSignature B58Bytes
	Generator           Address
	GeneratorPublicKey  crypto.PublicKey
	VRF                 B58Bytes
}

func BlockInfoFromHeader added in v0.3.0

func BlockInfoFromHeader(scheme byte, header *BlockHeader, height uint64, vrf []byte) (*BlockInfo, error)

type BlockMarshaller added in v0.7.0

type BlockMarshaller struct {
	// contains filtered or unexported fields
}

func (BlockMarshaller) Marshal added in v0.7.0

func (a BlockMarshaller) Marshal(scheme Scheme) ([]byte, 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

func (*BlockMessage) WriteTo

func (m *BlockMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes BlockMessage to io.Writer

type BlockVersion added in v0.3.0

type BlockVersion byte
const (
	GenesisBlockVersion BlockVersion = iota + 1
	PlainBlockVersion
	NgBlockVersion
	RewardBlockVersion
	ProtobufBlockVersion
)

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) BinarySize added in v0.5.0

func (a BooleanArgument) BinarySize() int

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

type BooleanDataEntry struct {
	Key   string
	Value bool
}

BooleanDataEntry represents a key-value pair that stores a bool value.

func (BooleanDataEntry) BinarySize added in v0.5.0

func (e BooleanDataEntry) BinarySize() int

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) ToProtobuf added in v0.5.0

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(version byte) 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(_ io.Reader) (n int64, err error)

func (BulkMessage) UnmarshalBinary added in v0.3.0

func (BulkMessage) UnmarshalBinary(_ []byte) error

func (BulkMessage) WriteTo added in v0.3.0

func (BulkMessage) WriteTo(_ io.Writer) (n int64, err 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) BinarySize added in v0.5.0

func (b Burn) BinarySize() int

func (Burn) GetFee added in v0.3.0

func (b Burn) GetFee() uint64

func (Burn) GetSenderPK added in v0.3.0

func (b Burn) GetSenderPK() crypto.PublicKey

func (Burn) GetTimestamp added in v0.3.0

func (b Burn) GetTimestamp() uint64

func (Burn) ToProtobuf added in v0.5.0

func (b Burn) ToProtobuf() *g.Transaction_Burn

func (*Burn) UnmarshalBinary added in v0.5.0

func (b *Burn) UnmarshalBinary(data []byte) error

func (Burn) Valid added in v0.3.0

func (b Burn) Valid() (bool, error)

type BurnScriptAction added in v0.5.0

type BurnScriptAction struct {
	AssetID  crypto.Digest // assetId
	Quantity int64         // quantity
}

BurnScriptAction is an action to burn some assets in response to script invocation.

func (*BurnScriptAction) ToProtobuf added in v0.5.0

func (a *BurnScriptAction) ToProtobuf() *g.InvokeScriptResult_Burn

type BurnWithProofs added in v0.5.0

type BurnWithProofs 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
}

BurnWithProofs same as BurnWithSig but version 2 with Proofs.

func NewUnsignedBurnWithProofs added in v0.5.0

func NewUnsignedBurnWithProofs(v, chainID byte, senderPK crypto.PublicKey, assetID crypto.Digest, amount, timestamp, fee uint64) *BurnWithProofs

NewUnsignedBurnWithProofs creates new BurnWithProofs transaction without proofs and ID.

func (BurnWithProofs) BinarySize added in v0.5.0

func (tx BurnWithProofs) BinarySize() int

func (*BurnWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *BurnWithProofs) BodyMarshalBinary() ([]byte, error)

func (*BurnWithProofs) Clone added in v0.5.0

func (tx *BurnWithProofs) Clone() *BurnWithProofs

func (*BurnWithProofs) GenerateID added in v0.5.0

func (tx *BurnWithProofs) GenerateID(scheme Scheme) error

func (BurnWithProofs) GetID added in v0.5.0

func (tx BurnWithProofs) GetID(scheme Scheme) ([]byte, error)

func (BurnWithProofs) GetTypeInfo added in v0.5.0

func (tx BurnWithProofs) GetTypeInfo() TransactionTypeInfo

func (BurnWithProofs) GetVersion added in v0.5.0

func (tx BurnWithProofs) GetVersion() byte

func (*BurnWithProofs) MarshalBinary added in v0.5.0

func (tx *BurnWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes BurnWithProofs transaction to its bytes representation.

func (*BurnWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *BurnWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*BurnWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *BurnWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*BurnWithProofs) Sign added in v0.5.0

func (tx *BurnWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*BurnWithProofs) ToProtobuf added in v0.5.0

func (tx *BurnWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*BurnWithProofs) ToProtobufSigned added in v0.5.0

func (tx *BurnWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*BurnWithProofs) UnmarshalBinary added in v0.5.0

func (tx *BurnWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads BurnWithProofs from its bytes representation.

func (*BurnWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *BurnWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*BurnWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *BurnWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*BurnWithProofs) Validate added in v0.8.0

func (tx *BurnWithProofs) Validate() (Transaction, error)

func (*BurnWithProofs) Verify added in v0.5.0

func (tx *BurnWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type BurnWithSig added in v0.5.0

type BurnWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Burn
}

BurnWithSig transaction allows to decrease the total supply of the existing asset. Asset must be reissuable.

func NewUnsignedBurnWithSig added in v0.5.0

func NewUnsignedBurnWithSig(senderPK crypto.PublicKey, assetID crypto.Digest, amount, timestamp, fee uint64) *BurnWithSig

NewUnsignedBurnWithSig creates new BurnWithSig transaction with no signature and ID.

func (BurnWithSig) BinarySize added in v0.5.0

func (tx BurnWithSig) BinarySize() int

func (*BurnWithSig) BodyMarshalBinary added in v0.5.0

func (tx *BurnWithSig) BodyMarshalBinary() ([]byte, error)

func (*BurnWithSig) Clone added in v0.5.0

func (tx *BurnWithSig) Clone() *BurnWithSig

func (*BurnWithSig) GenerateID added in v0.5.0

func (tx *BurnWithSig) GenerateID(scheme Scheme) error

func (BurnWithSig) GetID added in v0.5.0

func (tx BurnWithSig) GetID(scheme Scheme) ([]byte, error)

func (BurnWithSig) GetTypeInfo added in v0.5.0

func (tx BurnWithSig) GetTypeInfo() TransactionTypeInfo

func (BurnWithSig) GetVersion added in v0.5.0

func (tx BurnWithSig) GetVersion() byte

func (*BurnWithSig) MarshalBinary added in v0.5.0

func (tx *BurnWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves transaction to

func (*BurnWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *BurnWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*BurnWithSig) MarshalToProtobuf added in v0.5.0

func (tx *BurnWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*BurnWithSig) Sign added in v0.5.0

func (tx *BurnWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates and sets signature and ID of the transaction.

func (*BurnWithSig) ToProtobuf added in v0.5.0

func (tx *BurnWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*BurnWithSig) ToProtobufSigned added in v0.5.0

func (tx *BurnWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*BurnWithSig) UnmarshalBinary added in v0.5.0

func (tx *BurnWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction form its binary representation.

func (*BurnWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *BurnWithSig) UnmarshalFromProtobuf(data []byte) error

func (*BurnWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *BurnWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*BurnWithSig) Validate added in v0.8.0

func (tx *BurnWithSig) Validate() (Transaction, error)

func (*BurnWithSig) Verify added in v0.5.0

func (tx *BurnWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature of the transaction is valid for the given public key.

type ByVersion added in v0.3.0

type ByVersion []Version

func (ByVersion) Len added in v0.3.0

func (a ByVersion) Len() int

func (ByVersion) Less added in v0.3.0

func (a ByVersion) Less(i, j int) bool

func (ByVersion) Swap added in v0.3.0

func (a ByVersion) Swap(i, j int)

type Bytes added in v0.3.0

type Bytes []byte

func (Bytes) WriteTo added in v0.3.0

func (a Bytes) WriteTo(w io.Writer) (int64, error)

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

func (*CheckPointMessage) WriteTo

func (m *CheckPointMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes CheckPointMessage to io.Writer

type CheckpointItem

type CheckpointItem struct {
	Height    uint64
	Signature crypto.Signature
}

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) BinarySize added in v0.5.0

func (ca CreateAlias) BinarySize() int

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) ToProtobuf added in v0.5.0

func (ca CreateAlias) ToProtobuf() *g.Transaction_CreateAlias

func (*CreateAlias) UnmarshalBinary added in v0.5.0

func (ca *CreateAlias) UnmarshalBinary(data []byte) error

func (CreateAlias) Valid added in v0.3.0

func (ca CreateAlias) Valid() (bool, error)

type CreateAliasWithProofs added in v0.5.0

type CreateAliasWithProofs struct {
	Type    TransactionType `json:"type"`
	Version byte            `json:"version,omitempty"`
	ID      *crypto.Digest  `json:"id,omitempty"`
	Proofs  *ProofsV1       `json:"proofs,omitempty"`
	CreateAlias
}

func NewUnsignedCreateAliasWithProofs added in v0.5.0

func NewUnsignedCreateAliasWithProofs(v byte, senderPK crypto.PublicKey, alias Alias, fee, timestamp uint64) *CreateAliasWithProofs

func (CreateAliasWithProofs) BinarySize added in v0.5.0

func (tx CreateAliasWithProofs) BinarySize() int

func (*CreateAliasWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *CreateAliasWithProofs) BodyMarshalBinary() ([]byte, error)

func (*CreateAliasWithProofs) Clone added in v0.5.0

func (*CreateAliasWithProofs) GenerateID added in v0.5.0

func (tx *CreateAliasWithProofs) GenerateID(scheme Scheme) error

func (CreateAliasWithProofs) GetID added in v0.5.0

func (tx CreateAliasWithProofs) GetID(scheme Scheme) ([]byte, error)

func (CreateAliasWithProofs) GetTypeInfo added in v0.5.0

func (tx CreateAliasWithProofs) GetTypeInfo() TransactionTypeInfo

func (CreateAliasWithProofs) GetVersion added in v0.5.0

func (tx CreateAliasWithProofs) GetVersion() byte

func (*CreateAliasWithProofs) MarshalBinary added in v0.5.0

func (tx *CreateAliasWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*CreateAliasWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *CreateAliasWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*CreateAliasWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *CreateAliasWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*CreateAliasWithProofs) Sign added in v0.5.0

func (tx *CreateAliasWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*CreateAliasWithProofs) ToProtobuf added in v0.5.0

func (tx *CreateAliasWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*CreateAliasWithProofs) ToProtobufSigned added in v0.5.0

func (tx *CreateAliasWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*CreateAliasWithProofs) UnmarshalBinary added in v0.5.0

func (tx *CreateAliasWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads the transaction from bytes slice.

func (*CreateAliasWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *CreateAliasWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*CreateAliasWithProofs) UnmarshalJSON added in v0.5.0

func (tx *CreateAliasWithProofs) UnmarshalJSON(data []byte) error

func (*CreateAliasWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *CreateAliasWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*CreateAliasWithProofs) Validate added in v0.8.0

func (tx *CreateAliasWithProofs) Validate() (Transaction, error)

func (*CreateAliasWithProofs) Verify added in v0.5.0

func (tx *CreateAliasWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type CreateAliasWithSig added in v0.5.0

type CreateAliasWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	CreateAlias
}

func NewUnsignedCreateAliasWithSig added in v0.5.0

func NewUnsignedCreateAliasWithSig(senderPK crypto.PublicKey, alias Alias, fee, timestamp uint64) *CreateAliasWithSig

func (CreateAliasWithSig) BinarySize added in v0.5.0

func (tx CreateAliasWithSig) BinarySize() int

func (*CreateAliasWithSig) BodyMarshalBinary added in v0.5.0

func (tx *CreateAliasWithSig) BodyMarshalBinary() ([]byte, error)

func (*CreateAliasWithSig) Clone added in v0.5.0

func (*CreateAliasWithSig) GenerateID added in v0.5.0

func (tx *CreateAliasWithSig) GenerateID(scheme Scheme) error

func (CreateAliasWithSig) GetID added in v0.5.0

func (tx CreateAliasWithSig) GetID(scheme Scheme) ([]byte, error)

func (CreateAliasWithSig) GetTypeInfo added in v0.5.0

func (tx CreateAliasWithSig) GetTypeInfo() TransactionTypeInfo

func (CreateAliasWithSig) GetVersion added in v0.5.0

func (tx CreateAliasWithSig) GetVersion() byte

func (*CreateAliasWithSig) MarshalBinary added in v0.5.0

func (tx *CreateAliasWithSig) MarshalBinary() ([]byte, error)

func (*CreateAliasWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *CreateAliasWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*CreateAliasWithSig) MarshalToProtobuf added in v0.5.0

func (tx *CreateAliasWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*CreateAliasWithSig) Sign added in v0.5.0

func (tx *CreateAliasWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

func (*CreateAliasWithSig) ToProtobuf added in v0.5.0

func (tx *CreateAliasWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*CreateAliasWithSig) ToProtobufSigned added in v0.5.0

func (tx *CreateAliasWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*CreateAliasWithSig) UnmarshalBinary added in v0.5.0

func (tx *CreateAliasWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

func (*CreateAliasWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *CreateAliasWithSig) UnmarshalFromProtobuf(data []byte) error

func (*CreateAliasWithSig) UnmarshalJSON added in v0.5.0

func (tx *CreateAliasWithSig) UnmarshalJSON(data []byte) error

func (*CreateAliasWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *CreateAliasWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*CreateAliasWithSig) Validate added in v0.8.0

func (tx *CreateAliasWithSig) Validate() (Transaction, error)

func (*CreateAliasWithSig) Verify added in v0.5.0

func (tx *CreateAliasWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, 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

UnmarshalJSON 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(version byte) error
	BinarySize() int

	ToProtobuf() *g.DataTransactionData_DataEntry
}

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 NewDataEntryFromBytes added in v0.5.0

func NewDataEntryFromBytes(data []byte) (DataEntry, error)

func NewDataEntryFromValueBytes added in v0.3.0

func NewDataEntryFromValueBytes(valueBytes []byte) (DataEntry, error)

type DataEntryScriptAction added in v0.5.0

type DataEntryScriptAction struct {
	Entry DataEntry
}

DataEntryScriptAction is an action to manipulate account data state.

func (*DataEntryScriptAction) ToProtobuf added in v0.5.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 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
	DataDelete = DataValueType(0xff)
)

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 DataWithProofs added in v0.5.0

type DataWithProofs 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"`
}

DataWithProofs is first version of the transaction that puts data to the key-value storage of an account.

func NewUnsignedData

func NewUnsignedData(v byte, senderPK crypto.PublicKey, fee, timestamp uint64) *DataWithProofs

func (*DataWithProofs) AppendEntry added in v0.5.0

func (tx *DataWithProofs) AppendEntry(entry DataEntry) error

AppendEntry adds the entry to the transaction.

func (DataWithProofs) BinarySize added in v0.5.0

func (tx DataWithProofs) BinarySize() int

func (*DataWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *DataWithProofs) BodyMarshalBinary() ([]byte, error)

func (*DataWithProofs) Clone added in v0.5.0

func (tx *DataWithProofs) Clone() *DataWithProofs

func (*DataWithProofs) GenerateID added in v0.5.0

func (tx *DataWithProofs) GenerateID(scheme Scheme) error

func (DataWithProofs) GetFee added in v0.5.0

func (tx DataWithProofs) GetFee() uint64

func (DataWithProofs) GetID added in v0.5.0

func (tx DataWithProofs) GetID(scheme Scheme) ([]byte, error)

func (DataWithProofs) GetSenderPK added in v0.5.0

func (tx DataWithProofs) GetSenderPK() crypto.PublicKey

func (DataWithProofs) GetTimestamp added in v0.5.0

func (tx DataWithProofs) GetTimestamp() uint64

func (DataWithProofs) GetTypeInfo added in v0.5.0

func (tx DataWithProofs) GetTypeInfo() TransactionTypeInfo

func (DataWithProofs) GetVersion added in v0.5.0

func (tx DataWithProofs) GetVersion() byte

func (*DataWithProofs) MarshalBinary added in v0.5.0

func (tx *DataWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to bytes.

func (*DataWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *DataWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*DataWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *DataWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*DataWithProofs) ProtoPayload added in v0.8.8

func (tx *DataWithProofs) ProtoPayload(scheme Scheme) ([]byte, error)

func (*DataWithProofs) Sign added in v0.5.0

func (tx *DataWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign use given secret key to calculate signature of the transaction.

func (*DataWithProofs) ToProtobuf added in v0.5.0

func (tx *DataWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*DataWithProofs) ToProtobufSigned added in v0.5.0

func (tx *DataWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*DataWithProofs) UnmarshalBinary added in v0.5.0

func (tx *DataWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads the transaction from the bytes.

func (*DataWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *DataWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*DataWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *DataWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*DataWithProofs) Validate added in v0.8.0

func (tx *DataWithProofs) Validate() (Transaction, error)

func (*DataWithProofs) Verify added in v0.5.0

func (tx *DataWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature is valid for the given public key.

type DeleteDataEntry added in v0.5.0

type DeleteDataEntry struct {
	Key string
}

DeleteDataEntry structure stores the key that should be removed from state storage.

func (DeleteDataEntry) BinarySize added in v0.5.0

func (e DeleteDataEntry) BinarySize() int

func (DeleteDataEntry) GetKey added in v0.5.0

func (e DeleteDataEntry) GetKey() string

GetKey returns the key of key-value pair.

func (DeleteDataEntry) GetValueType added in v0.5.0

func (e DeleteDataEntry) GetValueType() DataValueType

GetValueType returns the type of value in key-value entry.

func (DeleteDataEntry) MarshalBinary added in v0.5.0

func (e DeleteDataEntry) MarshalBinary() ([]byte, error)

MarshalBinary converts the data entry to its byte representation.

func (DeleteDataEntry) MarshalJSON added in v0.5.0

func (e DeleteDataEntry) MarshalJSON() ([]byte, error)

MarshalJSON writes the entry to its JSON representation.

func (DeleteDataEntry) MarshalValue added in v0.5.0

func (e DeleteDataEntry) MarshalValue() ([]byte, error)

MarshalValue converts the data entry value to its byte representation.

func (*DeleteDataEntry) SetKey added in v0.5.0

func (e *DeleteDataEntry) SetKey(key string)

SetKey sets the key of data entry.

func (DeleteDataEntry) ToProtobuf added in v0.5.0

func (*DeleteDataEntry) UnmarshalBinary added in v0.5.0

func (e *DeleteDataEntry) UnmarshalBinary(data []byte) error

UnmarshalBinary reads StringDataEntry structure from bytes.

func (*DeleteDataEntry) UnmarshalJSON added in v0.5.0

func (e *DeleteDataEntry) UnmarshalJSON(value []byte) error

UnmarshalJSON reads the entry from JSON.

func (*DeleteDataEntry) UnmarshalValue added in v0.5.0

func (e *DeleteDataEntry) UnmarshalValue(data []byte) error

UnmarshalValue checks DeleteDataEntry value type is set.

func (DeleteDataEntry) Valid added in v0.5.0

func (e DeleteDataEntry) Valid(version byte) error

type DigestWrapped added in v0.6.0

type DigestWrapped crypto.Digest

Hex is required for state hashes API. The quickest way to use Hex for hashes in JSON in this particular case.

func (DigestWrapped) MarshalJSON added in v0.6.0

func (d DigestWrapped) MarshalJSON() ([]byte, error)

func (*DigestWrapped) UnmarshalJSON added in v0.6.0

func (d *DigestWrapped) UnmarshalJSON(value []byte) error

type Exchange added in v0.3.0

type Exchange interface {
	GetID(scheme Scheme) ([]byte, error)
	GetSenderPK() crypto.PublicKey
	GetBuyOrder() (Order, error)
	GetSellOrder() (Order, error)
	GetOrder1() Order
	GetOrder2() Order
	GetPrice() uint64
	GetAmount() uint64
	GetBuyMatcherFee() uint64
	GetSellMatcherFee() uint64
	GetFee() uint64
	GetTimestamp() uint64
}

type ExchangeWithProofs added in v0.5.0

type ExchangeWithProofs 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"`
	Order1         Order            `json:"order1"`
	Order2         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"`
}

ExchangeWithProofs is a transaction to store settlement on blockchain.

func NewUnsignedExchangeWithProofs added in v0.5.0

func NewUnsignedExchangeWithProofs(v byte, buy, sell Order, price, amount, buyMatcherFee, sellMatcherFee, fee, timestamp uint64) *ExchangeWithProofs

func (ExchangeWithProofs) BinarySize added in v0.5.0

func (tx ExchangeWithProofs) BinarySize() int

func (*ExchangeWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *ExchangeWithProofs) BodyMarshalBinary() ([]byte, error)

func (*ExchangeWithProofs) Clone added in v0.5.0

func (*ExchangeWithProofs) GenerateID added in v0.5.0

func (tx *ExchangeWithProofs) GenerateID(scheme Scheme) error

func (ExchangeWithProofs) GetAmount added in v0.5.0

func (tx ExchangeWithProofs) GetAmount() uint64

func (ExchangeWithProofs) GetBuyMatcherFee added in v0.5.0

func (tx ExchangeWithProofs) GetBuyMatcherFee() uint64

func (ExchangeWithProofs) GetBuyOrder added in v0.5.0

func (tx ExchangeWithProofs) GetBuyOrder() (Order, error)

func (ExchangeWithProofs) GetFee added in v0.5.0

func (tx ExchangeWithProofs) GetFee() uint64

func (ExchangeWithProofs) GetID added in v0.5.0

func (tx ExchangeWithProofs) GetID(scheme Scheme) ([]byte, error)

func (ExchangeWithProofs) GetOrder1 added in v0.5.0

func (tx ExchangeWithProofs) GetOrder1() Order

func (ExchangeWithProofs) GetOrder2 added in v0.5.0

func (tx ExchangeWithProofs) GetOrder2() Order

func (ExchangeWithProofs) GetPrice added in v0.5.0

func (tx ExchangeWithProofs) GetPrice() uint64

func (ExchangeWithProofs) GetSellMatcherFee added in v0.5.0

func (tx ExchangeWithProofs) GetSellMatcherFee() uint64

func (ExchangeWithProofs) GetSellOrder added in v0.5.0

func (tx ExchangeWithProofs) GetSellOrder() (Order, error)

func (ExchangeWithProofs) GetSenderPK added in v0.5.0

func (tx ExchangeWithProofs) GetSenderPK() crypto.PublicKey

func (ExchangeWithProofs) GetTimestamp added in v0.5.0

func (tx ExchangeWithProofs) GetTimestamp() uint64

func (ExchangeWithProofs) GetTypeInfo added in v0.5.0

func (tx ExchangeWithProofs) GetTypeInfo() TransactionTypeInfo

func (ExchangeWithProofs) GetVersion added in v0.5.0

func (tx ExchangeWithProofs) GetVersion() byte

func (*ExchangeWithProofs) MarshalBinary added in v0.5.0

func (tx *ExchangeWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*ExchangeWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *ExchangeWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*ExchangeWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *ExchangeWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*ExchangeWithProofs) Sign added in v0.5.0

func (tx *ExchangeWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates transaction signature using given secret key.

func (*ExchangeWithProofs) ToProtobuf added in v0.5.0

func (tx *ExchangeWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*ExchangeWithProofs) ToProtobufSigned added in v0.5.0

func (tx *ExchangeWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*ExchangeWithProofs) UnmarshalBinary added in v0.5.0

func (tx *ExchangeWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary loads the transaction from its binary representation.

func (*ExchangeWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *ExchangeWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*ExchangeWithProofs) UnmarshalJSON added in v0.5.0

func (tx *ExchangeWithProofs) UnmarshalJSON(data []byte) error

func (*ExchangeWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *ExchangeWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*ExchangeWithProofs) Validate added in v0.8.0

func (tx *ExchangeWithProofs) Validate() (Transaction, error)

func (*ExchangeWithProofs) Verify added in v0.5.0

func (tx *ExchangeWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the transaction signature is valid for given public key.

type ExchangeWithSig added in v0.5.0

type ExchangeWithSig 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"`
	Order1         *OrderV1          `json:"order1"`
	Order2         *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"`
}

ExchangeWithSig is a transaction to store settlement on blockchain.

func NewUnsignedExchangeWithSig added in v0.5.0

func NewUnsignedExchangeWithSig(buy, sell *OrderV1, price, amount, buyMatcherFee, sellMatcherFee, fee, timestamp uint64) *ExchangeWithSig

func (ExchangeWithSig) BinarySize added in v0.5.0

func (tx ExchangeWithSig) BinarySize() int

func (*ExchangeWithSig) BodyMarshalBinary added in v0.5.0

func (tx *ExchangeWithSig) BodyMarshalBinary() ([]byte, error)

func (*ExchangeWithSig) BodySerialize added in v0.5.0

func (tx *ExchangeWithSig) BodySerialize(s *serializer.Serializer) error

func (*ExchangeWithSig) Clone added in v0.5.0

func (tx *ExchangeWithSig) Clone() *ExchangeWithSig

func (*ExchangeWithSig) GenerateID added in v0.5.0

func (tx *ExchangeWithSig) GenerateID(scheme Scheme) error

func (ExchangeWithSig) GetAmount added in v0.5.0

func (tx ExchangeWithSig) GetAmount() uint64

func (ExchangeWithSig) GetBuyMatcherFee added in v0.5.0

func (tx ExchangeWithSig) GetBuyMatcherFee() uint64

func (ExchangeWithSig) GetBuyOrder added in v0.5.0

func (tx ExchangeWithSig) GetBuyOrder() (Order, error)

func (ExchangeWithSig) GetFee added in v0.5.0

func (tx ExchangeWithSig) GetFee() uint64

func (ExchangeWithSig) GetID added in v0.5.0

func (tx ExchangeWithSig) GetID(scheme Scheme) ([]byte, error)

func (ExchangeWithSig) GetOrder1 added in v0.5.0

func (tx ExchangeWithSig) GetOrder1() Order

func (ExchangeWithSig) GetOrder2 added in v0.5.0

func (tx ExchangeWithSig) GetOrder2() Order

func (ExchangeWithSig) GetPrice added in v0.5.0

func (tx ExchangeWithSig) GetPrice() uint64

func (ExchangeWithSig) GetSellMatcherFee added in v0.5.0

func (tx ExchangeWithSig) GetSellMatcherFee() uint64

func (ExchangeWithSig) GetSellOrder added in v0.5.0

func (tx ExchangeWithSig) GetSellOrder() (Order, error)

func (ExchangeWithSig) GetSenderPK added in v0.5.0

func (tx ExchangeWithSig) GetSenderPK() crypto.PublicKey

func (ExchangeWithSig) GetTimestamp added in v0.5.0

func (tx ExchangeWithSig) GetTimestamp() uint64

func (ExchangeWithSig) GetTypeInfo added in v0.5.0

func (tx ExchangeWithSig) GetTypeInfo() TransactionTypeInfo

func (ExchangeWithSig) GetVersion added in v0.5.0

func (tx ExchangeWithSig) GetVersion() byte

func (*ExchangeWithSig) MarshalBinary added in v0.5.0

func (tx *ExchangeWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*ExchangeWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *ExchangeWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*ExchangeWithSig) MarshalToProtobuf added in v0.5.0

func (tx *ExchangeWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*ExchangeWithSig) Sign added in v0.5.0

func (tx *ExchangeWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sing calculates ID and Signature of the transaction.

func (*ExchangeWithSig) ToProtobuf added in v0.5.0

func (tx *ExchangeWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*ExchangeWithSig) ToProtobufSigned added in v0.5.0

func (tx *ExchangeWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*ExchangeWithSig) UnmarshalBinary added in v0.5.0

func (tx *ExchangeWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary loads the transaction from its binary representation.

func (*ExchangeWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *ExchangeWithSig) UnmarshalFromProtobuf(data []byte) error

func (*ExchangeWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *ExchangeWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*ExchangeWithSig) Validate added in v0.8.0

func (tx *ExchangeWithSig) Validate() (Transaction, error)

func (*ExchangeWithSig) Verify added in v0.5.0

func (tx *ExchangeWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that signature of the transaction is valid.

type FieldsHashes added in v0.7.0

type FieldsHashes struct {
	DataEntryHash     crypto.Digest
	AccountScriptHash crypto.Digest
	AssetScriptHash   crypto.Digest
	LeaseStatusHash   crypto.Digest
	SponsorshipHash   crypto.Digest
	AliasesHash       crypto.Digest
	WavesBalanceHash  crypto.Digest
	AssetBalanceHash  crypto.Digest
	LeaseBalanceHash  crypto.Digest
}

func (FieldsHashes) MarshalJSON added in v0.7.0

func (s FieldsHashes) MarshalJSON() ([]byte, error)

func (*FieldsHashes) UnmarshalJSON added in v0.8.0

func (s *FieldsHashes) UnmarshalJSON(value []byte) error

type FullAssetInfo added in v0.5.0

type FullAssetInfo struct {
	AssetInfo
	Name             string
	Description      string
	ScriptInfo       ScriptInfo
	SponsorshipCost  uint64
	IssueTransaction Transaction
	SponsorBalance   uint64
}

func (*FullAssetInfo) ToProtobuf added in v0.5.0

func (i *FullAssetInfo) ToProtobuf(scheme Scheme) (*g.AssetInfoResponse, error)

type FullScriptTransfer added in v0.3.0

type FullScriptTransfer struct {
	Amount    uint64
	Asset     OptionalAsset
	Recipient Recipient
	Sender    Address
	SenderPK  crypto.PublicKey
	Timestamp uint64
	ID        *crypto.Digest
}

func NewFullScriptTransfer added in v0.3.0

func NewFullScriptTransfer(action *TransferScriptAction, sender Address, senderPK crypto.PublicKey, tx *InvokeScriptWithProofs) (*FullScriptTransfer, error)

type FullWavesBalance added in v0.5.0

type FullWavesBalance struct {
	Regular    uint64
	Generating uint64
	Available  uint64
	Effective  uint64
	LeaseIn    uint64
	LeaseOut   uint64
}

func (*FullWavesBalance) ToProtobuf added in v0.5.0

type FunctionCall added in v0.3.0

type FunctionCall struct {
	Default   bool
	Name      string
	Arguments Arguments
}

FunctionCall structure represents the description of function called in the InvokeScript transaction.

func (FunctionCall) BinarySize added in v0.5.0

func (c FunctionCall) BinarySize() int

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

func NewUnsignedGenesis(recipient Address, amount, timestamp uint64) *Genesis

NewUnsignedGenesis returns a new unsigned Genesis transaction. Actually Genesis transaction could not be signed.

func (Genesis) BinarySize added in v0.5.0

func (tx Genesis) BinarySize() int

func (*Genesis) BodyMarshalBinary added in v0.5.0

func (tx *Genesis) BodyMarshalBinary() ([]byte, error)

func (*Genesis) GenerateID added in v0.3.0

func (tx *Genesis) GenerateID(scheme Scheme) error

func (*Genesis) GenerateSig added in v0.5.0

func (tx *Genesis) GenerateSig() error

func (*Genesis) GenerateSigID

func (tx *Genesis) GenerateSigID(scheme Scheme) error

func (Genesis) GetFee added in v0.3.0

func (tx Genesis) GetFee() uint64

func (Genesis) GetID added in v0.2.0

func (tx Genesis) GetID(scheme Scheme) ([]byte, error)

func (Genesis) GetSenderPK added in v0.3.0

func (tx Genesis) GetSenderPK() crypto.PublicKey

func (Genesis) GetTimestamp added in v0.3.0

func (tx Genesis) GetTimestamp() uint64

func (Genesis) GetTypeInfo added in v0.5.0

func (tx Genesis) GetTypeInfo() TransactionTypeInfo

func (Genesis) GetVersion added in v0.5.0

func (tx Genesis) GetVersion() byte

func (*Genesis) MarshalBinary

func (tx *Genesis) MarshalBinary() ([]byte, error)

MarshalBinary writes transaction bytes to slice of bytes.

func (*Genesis) MarshalSignedToProtobuf added in v0.5.0

func (tx *Genesis) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*Genesis) MarshalToProtobuf added in v0.5.0

func (tx *Genesis) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*Genesis) Sign added in v0.5.0

func (tx *Genesis) Sign(scheme Scheme, sk crypto.SecretKey) error

func (*Genesis) ToProtobuf added in v0.5.0

func (tx *Genesis) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*Genesis) ToProtobufSigned added in v0.5.0

func (tx *Genesis) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*Genesis) UnmarshalBinary

func (tx *Genesis) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction values from the slice of bytes.

func (*Genesis) UnmarshalFromProtobuf added in v0.5.0

func (tx *Genesis) UnmarshalFromProtobuf(data []byte) error

func (*Genesis) UnmarshalJSON added in v0.5.0

func (tx *Genesis) UnmarshalJSON(data []byte) error

func (*Genesis) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *Genesis) UnmarshalSignedFromProtobuf(data []byte) error

func (*Genesis) Validate added in v0.8.0

func (tx *Genesis) Validate() (Transaction, error)

Validate checks the validity of transaction parameters and it's signature.

type GetBlockIdsMessage added in v0.5.0

type GetBlockIdsMessage struct {
	Blocks []BlockID
}

GetBlockIdsMessage is used for Signatures or hashes block ids

func (*GetBlockIdsMessage) MarshalBinary added in v0.5.0

func (m *GetBlockIdsMessage) MarshalBinary() ([]byte, error)

func (*GetBlockIdsMessage) ReadFrom added in v0.5.0

func (m *GetBlockIdsMessage) ReadFrom(r io.Reader) (int64, error)

func (*GetBlockIdsMessage) UnmarshalBinary added in v0.5.0

func (m *GetBlockIdsMessage) UnmarshalBinary(data []byte) error

func (*GetBlockIdsMessage) WriteTo added in v0.5.0

func (m *GetBlockIdsMessage) WriteTo(w io.Writer) (int64, error)

type GetBlockMessage

type GetBlockMessage struct {
	BlockID BlockID
}

GetBlockMessage represents GetBlock message

func (*GetBlockMessage) MarshalBinary

func (m *GetBlockMessage) MarshalBinary() ([]byte, error)

MarshalBinary encodes GetBlockMessage to binary form

func (*GetBlockMessage) ReadFrom

func (m *GetBlockMessage) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads GetBlockMessage from io.Reader

func (*GetBlockMessage) UnmarshalBinary

func (m *GetBlockMessage) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes GetBlockMessage from binary form

func (*GetBlockMessage) WriteTo

func (m *GetBlockMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes GetBlockMessage to io.Writer

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

func (*GetPeersMessage) WriteTo

func (m *GetPeersMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes GetPeersMessage to io.Writer

type GetSignaturesMessage

type GetSignaturesMessage struct {
	Signatures []crypto.Signature
}

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

func (*GetSignaturesMessage) WriteTo

func (m *GetSignaturesMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes GetSignaturesMessage to io.Writer

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

func (*Handshake) ReadFrom

func (a *Handshake) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads Handshake from io.Reader

func (*Handshake) WriteTo

func (a *Handshake) WriteTo(w io.Writer) (int64, error)

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

func (HandshakeTCPAddr) WriteTo added in v0.3.0

func (a HandshakeTCPAddr) WriteTo(w io.Writer) (int64, error)
type Header struct {
	Length          uint32
	Magic           uint32
	ContentID       uint8
	PayloadLength   uint32
	PayloadChecksum [headerChecksumLen]byte
}

func MakeHeader added in v0.3.0

func MakeHeader(contentID uint8, payload []byte) (Header, error)

func (*Header) Copy added in v0.3.0

func (h *Header) Copy(data []byte) (int, error)

func (*Header) HeaderLength added in v0.3.0

func (h *Header) HeaderLength() uint32

func (*Header) MarshalBinary added in v0.3.0

func (h *Header) MarshalBinary() ([]byte, error)

func (*Header) ReadFrom added in v0.3.0

func (h *Header) ReadFrom(r io.Reader) (int64, error)

func (*Header) UnmarshalBinary added in v0.3.0

func (h *Header) UnmarshalBinary(data []byte) error

func (*Header) WriteTo added in v0.3.0

func (h *Header) WriteTo(w io.Writer) (int64, error)

type Height added in v0.3.0

type Height = uint64

type InfoMsg added in v0.8.8

type InfoMsg struct {
	// contains filtered or unexported fields
}

func (*InfoMsg) Error added in v0.8.8

func (im *InfoMsg) Error() string

func (*InfoMsg) IsNil added in v0.8.8

func (im *InfoMsg) IsNil() bool

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) BinarySize added in v0.5.0

func (a IntegerArgument) BinarySize() int

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

type IntegerDataEntry struct {
	Key   string
	Value int64
}

IntegerDataEntry stores int64 value.

func (IntegerDataEntry) BinarySize added in v0.5.0

func (e IntegerDataEntry) BinarySize() int

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) ToProtobuf added in v0.5.0

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(version byte) error

type InvokeScriptWithProofs added in v0.5.0

type InvokeScriptWithProofs 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 NewUnsignedInvokeScriptWithProofs added in v0.5.0

func NewUnsignedInvokeScriptWithProofs(v, chain byte, senderPK crypto.PublicKey, scriptRecipient Recipient, call FunctionCall, payments ScriptPayments, feeAsset OptionalAsset, fee, timestamp uint64) *InvokeScriptWithProofs

NewUnsignedSetAssetScriptWithProofs creates new unsigned SetAssetScriptWithProofs transaction.

func (*InvokeScriptWithProofs) BinarySize added in v0.5.0

func (tx *InvokeScriptWithProofs) BinarySize() int

func (*InvokeScriptWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *InvokeScriptWithProofs) BodyMarshalBinary() ([]byte, error)

func (*InvokeScriptWithProofs) BodySerialize added in v0.5.0

func (tx *InvokeScriptWithProofs) BodySerialize(s *serializer.Serializer) error

func (*InvokeScriptWithProofs) Clone added in v0.5.0

func (*InvokeScriptWithProofs) GenerateID added in v0.5.0

func (tx *InvokeScriptWithProofs) GenerateID(scheme Scheme) error

func (InvokeScriptWithProofs) GetFee added in v0.5.0

func (tx InvokeScriptWithProofs) GetFee() uint64

func (InvokeScriptWithProofs) GetID added in v0.5.0

func (tx InvokeScriptWithProofs) GetID(scheme Scheme) ([]byte, error)

func (InvokeScriptWithProofs) GetSenderPK added in v0.5.0

func (tx InvokeScriptWithProofs) GetSenderPK() crypto.PublicKey

func (InvokeScriptWithProofs) GetTimestamp added in v0.5.0

func (tx InvokeScriptWithProofs) GetTimestamp() uint64

func (InvokeScriptWithProofs) GetTypeInfo added in v0.5.0

func (InvokeScriptWithProofs) GetVersion added in v0.5.0

func (tx InvokeScriptWithProofs) GetVersion() byte

func (*InvokeScriptWithProofs) MarshalBinary added in v0.5.0

func (tx *InvokeScriptWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes InvokeScriptWithProofs transaction to its bytes representation.

func (*InvokeScriptWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *InvokeScriptWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*InvokeScriptWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *InvokeScriptWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*InvokeScriptWithProofs) ProtobufVersion added in v0.8.0

func (tx *InvokeScriptWithProofs) ProtobufVersion() byte

func (*InvokeScriptWithProofs) Serialize added in v0.5.0

Serialize InvokeScriptWithProofs transaction to its bytes representation.

func (*InvokeScriptWithProofs) Sign added in v0.5.0

func (tx *InvokeScriptWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*InvokeScriptWithProofs) ToProtobuf added in v0.5.0

func (tx *InvokeScriptWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*InvokeScriptWithProofs) ToProtobufSigned added in v0.5.0

func (tx *InvokeScriptWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*InvokeScriptWithProofs) UnmarshalBinary added in v0.5.0

func (tx *InvokeScriptWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads InvokeScriptWithProofs transaction from its binary representation.

func (*InvokeScriptWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *InvokeScriptWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*InvokeScriptWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *InvokeScriptWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*InvokeScriptWithProofs) Validate added in v0.8.0

func (tx *InvokeScriptWithProofs) Validate() (Transaction, error)

func (*InvokeScriptWithProofs) Verify added in v0.5.0

func (tx *InvokeScriptWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type IpPort added in v0.3.0

type IpPort [IpPortLength]byte

func NewIpPortFromTcpAddr added in v0.3.0

func NewIpPortFromTcpAddr(a TCPAddr) IpPort

func (IpPort) Addr added in v0.3.0

func (a IpPort) Addr() net.IP

func (IpPort) Port added in v0.3.0

func (a IpPort) Port() int

func (*IpPort) String added in v0.3.0

func (a *IpPort) String() string

func (IpPort) ToTcpAddr added in v0.3.0

func (a IpPort) ToTcpAddr() TCPAddr

func (*IpPort) UnmarshalBinary added in v0.3.0

func (a *IpPort) UnmarshalBinary(b []byte) error

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) BinarySize added in v0.5.0

func (i Issue) BinarySize() int

func (Issue) GetFee added in v0.3.0

func (i Issue) GetFee() uint64

func (Issue) GetSenderPK added in v0.3.0

func (i Issue) GetSenderPK() crypto.PublicKey

func (Issue) GetTimestamp added in v0.3.0

func (i Issue) GetTimestamp() uint64

func (*Issue) ToProtobuf added in v0.5.0

func (i *Issue) ToProtobuf() *g.Transaction_Issue

func (*Issue) UnmarshalBinary added in v0.5.0

func (i *Issue) UnmarshalBinary(data []byte) error

func (Issue) Valid added in v0.3.0

func (i Issue) Valid() (bool, error)

type IssueScriptAction added in v0.5.0

type IssueScriptAction struct {
	ID          crypto.Digest // calculated field
	Name        string        // name
	Description string        // description
	Quantity    int64         // quantity
	Decimals    int32         // decimals
	Reissuable  bool          // isReissuable
	Script      []byte        // compiledScript //TODO: reversed for future use
	Nonce       int64         // nonce
}

IssueScriptAction is an action to issue a new asset as a result of script invocation.

func (*IssueScriptAction) ToProtobuf added in v0.5.0

func (a *IssueScriptAction) ToProtobuf() *g.InvokeScriptResult_Issue

type IssueWithProofs added in v0.5.0

type IssueWithProofs 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
}

IssueWithProofs is a transaction to issue new asset, second version.

func NewUnsignedIssueWithProofs added in v0.5.0

func NewUnsignedIssueWithProofs(v, chainID byte, senderPK crypto.PublicKey, name, description string, quantity uint64, decimals byte, reissuable bool, script []byte, timestamp, fee uint64) *IssueWithProofs

NewUnsignedIssueWithProofs creates a new IssueWithProofs transaction with empty Proofs.

func (IssueWithProofs) BinarySize added in v0.5.0

func (tx IssueWithProofs) BinarySize() int

func (*IssueWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *IssueWithProofs) BodyMarshalBinary() ([]byte, error)

func (*IssueWithProofs) Clone added in v0.5.0

func (tx *IssueWithProofs) Clone() *IssueWithProofs

func (*IssueWithProofs) GenerateID added in v0.5.0

func (tx *IssueWithProofs) GenerateID(scheme Scheme) error

func (IssueWithProofs) GetID added in v0.5.0

func (tx IssueWithProofs) GetID(scheme Scheme) ([]byte, error)

func (IssueWithProofs) GetTypeInfo added in v0.5.0

func (tx IssueWithProofs) GetTypeInfo() TransactionTypeInfo

func (IssueWithProofs) GetVersion added in v0.5.0

func (tx IssueWithProofs) GetVersion() byte

func (*IssueWithProofs) MarshalBinary added in v0.5.0

func (tx *IssueWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary converts transaction to its binary representation.

func (*IssueWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *IssueWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*IssueWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *IssueWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*IssueWithProofs) NonEmptyScript added in v0.5.0

func (tx *IssueWithProofs) NonEmptyScript() bool

NonEmptyScript returns true if the script of the transaction is not empty, otherwise false.

func (*IssueWithProofs) Sign added in v0.5.0

func (tx *IssueWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates transaction signature using given secret key.

func (*IssueWithProofs) ToProtobuf added in v0.5.0

func (tx *IssueWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*IssueWithProofs) ToProtobufSigned added in v0.5.0

func (tx *IssueWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*IssueWithProofs) UnmarshalBinary added in v0.5.0

func (tx *IssueWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction from its binary representation.

func (*IssueWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *IssueWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*IssueWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *IssueWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*IssueWithProofs) Validate added in v0.8.0

func (tx *IssueWithProofs) Validate() (Transaction, error)

func (*IssueWithProofs) Verify added in v0.5.0

func (tx *IssueWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the transaction signature is valid for given public key.

type IssueWithSig added in v0.5.0

type IssueWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Issue
}

IssueWithSig transaction is a transaction to issue new asset.

func NewUnsignedIssueWithSig added in v0.5.0

func NewUnsignedIssueWithSig(senderPK crypto.PublicKey, name, description string, quantity uint64, decimals byte, reissuable bool, timestamp, fee uint64) *IssueWithSig

NewUnsignedIssueWithSig creates new IssueWithSig transaction without signature and ID.

func (IssueWithSig) BinarySize added in v0.5.0

func (tx IssueWithSig) BinarySize() int

func (*IssueWithSig) BodyMarshalBinary added in v0.5.0

func (tx *IssueWithSig) BodyMarshalBinary() ([]byte, error)

func (*IssueWithSig) Clone added in v0.5.0

func (tx *IssueWithSig) Clone() *IssueWithSig

func (*IssueWithSig) GenerateID added in v0.5.0

func (tx *IssueWithSig) GenerateID(scheme Scheme) error

func (IssueWithSig) GetID added in v0.5.0

func (tx IssueWithSig) GetID(scheme Scheme) ([]byte, error)

func (IssueWithSig) GetTypeInfo added in v0.5.0

func (tx IssueWithSig) GetTypeInfo() TransactionTypeInfo

func (IssueWithSig) GetVersion added in v0.5.0

func (tx IssueWithSig) GetVersion() byte

func (*IssueWithSig) MarshalBinary added in v0.5.0

func (tx *IssueWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves transaction's binary representation to slice of bytes.

func (*IssueWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *IssueWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*IssueWithSig) MarshalToProtobuf added in v0.5.0

func (tx *IssueWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*IssueWithSig) Sign added in v0.5.0

func (tx *IssueWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign uses secretKey to sing the transaction.

func (*IssueWithSig) ToProtobuf added in v0.5.0

func (tx *IssueWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*IssueWithSig) ToProtobufSigned added in v0.5.0

func (tx *IssueWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*IssueWithSig) UnmarshalBinary added in v0.5.0

func (tx *IssueWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction from its binary representation.

func (*IssueWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *IssueWithSig) UnmarshalFromProtobuf(data []byte) error

func (*IssueWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *IssueWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*IssueWithSig) Validate added in v0.8.0

func (tx *IssueWithSig) Validate() (Transaction, error)

func (*IssueWithSig) Verify added in v0.5.0

func (tx *IssueWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature of transaction is a valid signature for given public key.

type KeyPair added in v0.3.0

type KeyPair struct {
	Public crypto.PublicKey
	Secret crypto.SecretKey
	// contains filtered or unexported fields
}

func MustKeyPair added in v0.5.0

func MustKeyPair(seed []byte) KeyPair

func NewKeyPair added in v0.3.0

func NewKeyPair(seed []byte) (KeyPair, error)

func (KeyPair) Addr added in v0.3.0

func (a KeyPair) Addr(scheme byte) (Address, error)

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) BinarySize added in v0.5.0

func (l Lease) BinarySize() int

func (Lease) GetFee added in v0.3.0

func (l Lease) GetFee() uint64

func (Lease) GetSenderPK added in v0.3.0

func (l Lease) GetSenderPK() crypto.PublicKey

func (Lease) GetTimestamp added in v0.3.0

func (l Lease) GetTimestamp() uint64

func (Lease) ToProtobuf added in v0.5.0

func (l Lease) ToProtobuf() (*g.Transaction_Lease, error)

func (*Lease) UnmarshalBinary added in v0.5.0

func (l *Lease) UnmarshalBinary(data []byte) error

func (Lease) Valid added in v0.3.0

func (l Lease) Valid() (bool, error)

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) BinarySize added in v0.5.0

func (lc LeaseCancel) BinarySize() int

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) ToProtobuf added in v0.5.0

func (lc LeaseCancel) ToProtobuf() *g.Transaction_LeaseCancel

func (*LeaseCancel) UnmarshalBinary added in v0.5.0

func (lc *LeaseCancel) UnmarshalBinary(data []byte) error

func (LeaseCancel) Valid added in v0.3.0

func (lc LeaseCancel) Valid() (bool, error)

type LeaseCancelWithProofs added in v0.5.0

type LeaseCancelWithProofs struct {
	Type    TransactionType `json:"type"`
	Version byte            `json:"version,omitempty"`
	ChainID byte            `json:"chainId"`
	ID      *crypto.Digest  `json:"id,omitempty"`
	Proofs  *ProofsV1       `json:"proofs,omitempty"`
	LeaseCancel
}

LeaseCancelWithProofs same as LeaseCancelWithSig but with proofs.

func NewUnsignedLeaseCancelWithProofs added in v0.5.0

func NewUnsignedLeaseCancelWithProofs(v, chainID byte, senderPK crypto.PublicKey, leaseID crypto.Digest, fee, timestamp uint64) *LeaseCancelWithProofs

NewUnsignedLeaseCancelWithProofs creates new LeaseCancelWithProofs transaction structure without a signature and an ID.

func (LeaseCancelWithProofs) BinarySize added in v0.5.0

func (tx LeaseCancelWithProofs) BinarySize() int

func (*LeaseCancelWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *LeaseCancelWithProofs) BodyMarshalBinary() ([]byte, error)

func (*LeaseCancelWithProofs) Clone added in v0.5.0

func (*LeaseCancelWithProofs) GenerateID added in v0.5.0

func (tx *LeaseCancelWithProofs) GenerateID(scheme Scheme) error

func (LeaseCancelWithProofs) GetID added in v0.5.0

func (tx LeaseCancelWithProofs) GetID(scheme Scheme) ([]byte, error)

func (LeaseCancelWithProofs) GetTypeInfo added in v0.5.0

func (tx LeaseCancelWithProofs) GetTypeInfo() TransactionTypeInfo

func (LeaseCancelWithProofs) GetVersion added in v0.5.0

func (tx LeaseCancelWithProofs) GetVersion() byte

func (*LeaseCancelWithProofs) MarshalBinary added in v0.5.0

func (tx *LeaseCancelWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*LeaseCancelWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *LeaseCancelWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseCancelWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *LeaseCancelWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseCancelWithProofs) Sign added in v0.5.0

func (tx *LeaseCancelWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*LeaseCancelWithProofs) ToProtobuf added in v0.5.0

func (tx *LeaseCancelWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*LeaseCancelWithProofs) ToProtobufSigned added in v0.5.0

func (tx *LeaseCancelWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*LeaseCancelWithProofs) UnmarshalBinary added in v0.5.0

func (tx *LeaseCancelWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads the transaction from bytes slice.

func (*LeaseCancelWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *LeaseCancelWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*LeaseCancelWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *LeaseCancelWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*LeaseCancelWithProofs) Validate added in v0.8.0

func (tx *LeaseCancelWithProofs) Validate() (Transaction, error)

func (*LeaseCancelWithProofs) Verify added in v0.5.0

func (tx *LeaseCancelWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type LeaseCancelWithSig added in v0.5.0

type LeaseCancelWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	LeaseCancel
}

LeaseCancelWithSig transaction can be used to cancel previously created leasing.

func NewUnsignedLeaseCancelWithSig added in v0.5.0

func NewUnsignedLeaseCancelWithSig(senderPK crypto.PublicKey, leaseID crypto.Digest, fee, timestamp uint64) *LeaseCancelWithSig

NewUnsignedLeaseCancelWithSig creates new LeaseCancelWithSig transaction structure without a signature and an ID.

func (LeaseCancelWithSig) BinarySize added in v0.5.0

func (tx LeaseCancelWithSig) BinarySize() int

func (*LeaseCancelWithSig) BodyMarshalBinary added in v0.5.0

func (tx *LeaseCancelWithSig) BodyMarshalBinary() ([]byte, error)

func (*LeaseCancelWithSig) Clone added in v0.5.0

func (*LeaseCancelWithSig) GenerateID added in v0.5.0

func (tx *LeaseCancelWithSig) GenerateID(scheme Scheme) error

func (LeaseCancelWithSig) GetID added in v0.5.0

func (tx LeaseCancelWithSig) GetID(scheme Scheme) ([]byte, error)

func (LeaseCancelWithSig) GetTypeInfo added in v0.5.0

func (tx LeaseCancelWithSig) GetTypeInfo() TransactionTypeInfo

func (LeaseCancelWithSig) GetVersion added in v0.5.0

func (tx LeaseCancelWithSig) GetVersion() byte

func (*LeaseCancelWithSig) MarshalBinary added in v0.5.0

func (tx *LeaseCancelWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves transaction to its binary representation.

func (*LeaseCancelWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *LeaseCancelWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseCancelWithSig) MarshalToProtobuf added in v0.5.0

func (tx *LeaseCancelWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseCancelWithSig) Sign added in v0.5.0

func (tx *LeaseCancelWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

func (*LeaseCancelWithSig) ToProtobuf added in v0.5.0

func (tx *LeaseCancelWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*LeaseCancelWithSig) ToProtobufSigned added in v0.5.0

func (tx *LeaseCancelWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*LeaseCancelWithSig) UnmarshalBinary added in v0.5.0

func (tx *LeaseCancelWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

func (*LeaseCancelWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *LeaseCancelWithSig) UnmarshalFromProtobuf(data []byte) error

func (*LeaseCancelWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *LeaseCancelWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*LeaseCancelWithSig) Validate added in v0.8.0

func (tx *LeaseCancelWithSig) Validate() (Transaction, error)

func (*LeaseCancelWithSig) Verify added in v0.5.0

func (tx *LeaseCancelWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that signature of the transaction is valid for the given public key.

type LeaseWithProofs added in v0.5.0

type LeaseWithProofs struct {
	Type    TransactionType `json:"type"`
	Version byte            `json:"version,omitempty"`
	ID      *crypto.Digest  `json:"id,omitempty"`
	Proofs  *ProofsV1       `json:"proofs,omitempty"`
	Lease
}

LeaseWithProofs is a second version of the LeaseWithSig transaction.

func NewUnsignedLeaseWithProofs added in v0.5.0

func NewUnsignedLeaseWithProofs(v byte, senderPK crypto.PublicKey, recipient Recipient, amount, fee, timestamp uint64) *LeaseWithProofs

NewUnsignedLeaseWithProofs creates new LeaseWithSig transaction without signature and ID set.

func (LeaseWithProofs) BinarySize added in v0.5.0

func (tx LeaseWithProofs) BinarySize() int

func (*LeaseWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *LeaseWithProofs) BodyMarshalBinary() ([]byte, error)

func (*LeaseWithProofs) Clone added in v0.5.0

func (tx *LeaseWithProofs) Clone() *LeaseWithProofs

func (*LeaseWithProofs) GenerateID added in v0.5.0

func (tx *LeaseWithProofs) GenerateID(scheme Scheme) error

func (LeaseWithProofs) GetID added in v0.5.0

func (tx LeaseWithProofs) GetID(scheme Scheme) ([]byte, error)

func (LeaseWithProofs) GetTypeInfo added in v0.5.0

func (tx LeaseWithProofs) GetTypeInfo() TransactionTypeInfo

func (LeaseWithProofs) GetVersion added in v0.5.0

func (tx LeaseWithProofs) GetVersion() byte

func (*LeaseWithProofs) MarshalBinary added in v0.5.0

func (tx *LeaseWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*LeaseWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *LeaseWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *LeaseWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseWithProofs) Sign added in v0.5.0

func (tx *LeaseWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*LeaseWithProofs) ToProtobuf added in v0.5.0

func (tx *LeaseWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*LeaseWithProofs) ToProtobufSigned added in v0.5.0

func (tx *LeaseWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*LeaseWithProofs) UnmarshalBinary added in v0.5.0

func (tx *LeaseWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads the transaction from bytes slice.

func (*LeaseWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *LeaseWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*LeaseWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *LeaseWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*LeaseWithProofs) Validate added in v0.8.0

func (tx *LeaseWithProofs) Validate() (Transaction, error)

func (*LeaseWithProofs) Verify added in v0.5.0

func (tx *LeaseWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type LeaseWithSig added in v0.5.0

type LeaseWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Lease
}

LeaseWithSig is a transaction that allows to lease Waves to other account.

func NewUnsignedLeaseWithSig added in v0.5.0

func NewUnsignedLeaseWithSig(senderPK crypto.PublicKey, recipient Recipient, amount, fee, timestamp uint64) *LeaseWithSig

NewUnsignedLeaseWithSig creates new LeaseWithSig transaction without signature and ID set.

func (LeaseWithSig) BinarySize added in v0.5.0

func (tx LeaseWithSig) BinarySize() int

func (*LeaseWithSig) BodyMarshalBinary added in v0.5.0

func (tx *LeaseWithSig) BodyMarshalBinary() ([]byte, error)

func (*LeaseWithSig) Clone added in v0.5.0

func (tx *LeaseWithSig) Clone() *LeaseWithSig

func (*LeaseWithSig) GenerateID added in v0.5.0

func (tx *LeaseWithSig) GenerateID(scheme Scheme) error

func (LeaseWithSig) GetID added in v0.5.0

func (tx LeaseWithSig) GetID(scheme Scheme) ([]byte, error)

func (LeaseWithSig) GetTypeInfo added in v0.5.0

func (tx LeaseWithSig) GetTypeInfo() TransactionTypeInfo

func (LeaseWithSig) GetVersion added in v0.5.0

func (tx LeaseWithSig) GetVersion() byte

func (*LeaseWithSig) MarshalBinary added in v0.5.0

func (tx *LeaseWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*LeaseWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *LeaseWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseWithSig) MarshalToProtobuf added in v0.5.0

func (tx *LeaseWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*LeaseWithSig) Sign added in v0.5.0

func (tx *LeaseWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates ID and Signature of the transaction.

func (*LeaseWithSig) ToProtobuf added in v0.5.0

func (tx *LeaseWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*LeaseWithSig) ToProtobufSigned added in v0.5.0

func (tx *LeaseWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*LeaseWithSig) UnmarshalBinary added in v0.5.0

func (tx *LeaseWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads the transaction from bytes slice.

func (*LeaseWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *LeaseWithSig) UnmarshalFromProtobuf(data []byte) error

func (*LeaseWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *LeaseWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*LeaseWithSig) Validate added in v0.8.0

func (tx *LeaseWithSig) Validate() (Transaction, error)

func (*LeaseWithSig) Verify added in v0.5.0

func (tx *LeaseWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature of the transaction is valid for the given public key.

type ListArgument added in v0.8.0

type ListArgument struct {
	Items Arguments
}

func NewListArgument added in v0.8.0

func NewListArgument(items Arguments) *ListArgument

func (ListArgument) BinarySize added in v0.8.0

func (a ListArgument) BinarySize() int

func (ListArgument) GetValueType added in v0.8.0

func (a ListArgument) GetValueType() ArgumentValueType

GetValueType returns the type of value of the argument.

func (ListArgument) MarshalBinary added in v0.8.0

func (a ListArgument) MarshalBinary() ([]byte, error)

MarshalBinary converts the argument to its byte representation.

func (ListArgument) MarshalJSON added in v0.8.0

func (a ListArgument) MarshalJSON() ([]byte, error)

MarshalJSON writes the entry to its JSON representation.

func (ListArgument) Serialize added in v0.8.0

func (a ListArgument) Serialize(s *serializer.Serializer) error

Serialize argument to its byte representation.

func (*ListArgument) UnmarshalBinary added in v0.8.0

func (a *ListArgument) UnmarshalBinary(data []byte) error

UnmarshalBinary reads an StringArgument structure from bytes.

func (*ListArgument) UnmarshalJSON added in v0.8.0

func (a *ListArgument) UnmarshalJSON(value []byte) error

UnmarshalJSON reads the entry from JSON.

type Marshaller added in v0.7.0

type Marshaller interface {
	Marshal(scheme Scheme) ([]byte, error)
}

type MassTransferEntry

type MassTransferEntry struct {
	Recipient Recipient `json:"recipient"`
	Amount    uint64    `json:"amount"`
}

func (*MassTransferEntry) BinarySize added in v0.5.0

func (e *MassTransferEntry) BinarySize() int

func (*MassTransferEntry) MarshalBinary

func (e *MassTransferEntry) MarshalBinary() ([]byte, error)

func (*MassTransferEntry) ToProtobuf added in v0.5.0

func (*MassTransferEntry) UnmarshalBinary

func (e *MassTransferEntry) UnmarshalBinary(data []byte) error

type MassTransferWithProofs added in v0.5.0

type MassTransferWithProofs 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"`
}

MassTransferWithProofs is a transaction that performs multiple transfers of one asset to the accounts at once.

func NewUnsignedMassTransferWithProofs added in v0.5.0

func NewUnsignedMassTransferWithProofs(v byte, senderPK crypto.PublicKey, asset OptionalAsset, transfers []MassTransferEntry, fee, timestamp uint64, attachment Attachment) *MassTransferWithProofs

NewUnsignedMassTransferWithProofs creates new MassTransferWithProofs transaction structure without signature and ID.

func (MassTransferWithProofs) BinarySize added in v0.5.0

func (tx MassTransferWithProofs) BinarySize() int

func (*MassTransferWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *MassTransferWithProofs) BodyMarshalBinary() ([]byte, error)

func (*MassTransferWithProofs) Clone added in v0.5.0

func (*MassTransferWithProofs) GenerateID added in v0.5.0

func (tx *MassTransferWithProofs) GenerateID(scheme Scheme) error

func (MassTransferWithProofs) GetFee added in v0.5.0

func (tx MassTransferWithProofs) GetFee() uint64

func (MassTransferWithProofs) GetID added in v0.5.0

func (tx MassTransferWithProofs) GetID(scheme Scheme) ([]byte, error)

func (MassTransferWithProofs) GetSenderPK added in v0.5.0

func (tx MassTransferWithProofs) GetSenderPK() crypto.PublicKey

func (MassTransferWithProofs) GetTimestamp added in v0.5.0

func (tx MassTransferWithProofs) GetTimestamp() uint64

func (MassTransferWithProofs) GetTypeInfo added in v0.5.0

func (MassTransferWithProofs) GetVersion added in v0.5.0

func (tx MassTransferWithProofs) GetVersion() byte

func (MassTransferWithProofs) HasRecipient added in v0.5.0

func (tx MassTransferWithProofs) HasRecipient(rcp Recipient) bool

func (*MassTransferWithProofs) MarshalBinary added in v0.5.0

func (tx *MassTransferWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*MassTransferWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *MassTransferWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*MassTransferWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *MassTransferWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*MassTransferWithProofs) Sign added in v0.5.0

func (tx *MassTransferWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates signature and ID of the transaction.

func (*MassTransferWithProofs) ToProtobuf added in v0.5.0

func (tx *MassTransferWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*MassTransferWithProofs) ToProtobufSigned added in v0.5.0

func (tx *MassTransferWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*MassTransferWithProofs) UnmarshalBinary added in v0.5.0

func (tx *MassTransferWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary loads transaction from its binary representation.

func (*MassTransferWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *MassTransferWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*MassTransferWithProofs) UnmarshalJSON added in v0.5.0

func (tx *MassTransferWithProofs) UnmarshalJSON(data []byte) error

func (*MassTransferWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *MassTransferWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*MassTransferWithProofs) Validate added in v0.8.0

func (tx *MassTransferWithProofs) Validate() (Transaction, error)

func (*MassTransferWithProofs) Verify added in v0.5.0

func (tx *MassTransferWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature is valid for the given public key.

type Message added in v0.3.0

func MessageByBlock added in v0.5.0

func MessageByBlock(block *Block, scheme Scheme) (Message, error)

func UnmarshalMessage added in v0.3.0

func UnmarshalMessage(b []byte) (Message, error)

UnmarshalMessage tries unmarshal bytes to proper type

type MicroBlock added in v0.3.0

type MicroBlock struct {
	VersionField byte
	// Reference for previous block.
	Reference BlockID
	// Block signature.
	TotalResBlockSigField crypto.Signature
	TotalBlockID          BlockID
	TransactionCount      uint32
	Transactions          Transactions
	SenderPK              crypto.PublicKey
	Signature             crypto.Signature
}

func (*MicroBlock) MarshalBinary added in v0.6.0

func (a *MicroBlock) MarshalBinary(scheme Scheme) ([]byte, error)

func (*MicroBlock) MarshalToProtobuf added in v0.5.0

func (a *MicroBlock) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*MicroBlock) Sign added in v0.3.0

func (a *MicroBlock) Sign(scheme Scheme, secret crypto.SecretKey) error

func (*MicroBlock) ToProtobuf added in v0.5.0

func (a *MicroBlock) ToProtobuf(scheme Scheme) (*g.SignedMicroBlock, error)

func (*MicroBlock) UnmarshalBinary added in v0.3.0

func (a *MicroBlock) UnmarshalBinary(b []byte, scheme Scheme) error

func (*MicroBlock) UnmarshalFromProtobuf added in v0.5.0

func (a *MicroBlock) UnmarshalFromProtobuf(b []byte) error

func (*MicroBlock) VerifySignature added in v0.3.0

func (a *MicroBlock) VerifySignature(scheme Scheme) (bool, error)

func (*MicroBlock) WriteTo added in v0.3.0

func (a *MicroBlock) WriteTo(scheme Scheme, w io.Writer) (int64, error)

func (*MicroBlock) WriteWithoutSignature added in v0.3.0

func (a *MicroBlock) WriteWithoutSignature(scheme Scheme, w io.Writer) (int64, error)

type MicroBlockInv added in v0.3.0

type MicroBlockInv struct {
	PublicKey    crypto.PublicKey
	TotalBlockID BlockID
	Reference    BlockID
	Signature    crypto.Signature
}

func NewUnsignedMicroblockInv added in v0.3.0

func NewUnsignedMicroblockInv(PublicKey crypto.PublicKey, TotalBlockID BlockID, Reference BlockID) *MicroBlockInv

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

func (*MicroBlockInv) Verify added in v0.3.0

func (a *MicroBlockInv) Verify(schema Scheme) (bool, error)

func (*MicroBlockInv) WriteTo added in v0.3.0

func (a *MicroBlockInv) WriteTo(w io.Writer) (int64, 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(_ io.Reader) (n int64, err error)

func (*MicroBlockInvMessage) UnmarshalBinary added in v0.3.0

func (a *MicroBlockInvMessage) UnmarshalBinary(data []byte) error

func (*MicroBlockInvMessage) WriteTo added in v0.3.0

func (a *MicroBlockInvMessage) WriteTo(w io.Writer) (n int64, err error)

type MicroBlockMessage added in v0.3.0

type MicroBlockMessage struct {
	Body []byte
}

MicroBlockMessage represents a MicroBlock 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(_ io.Reader) (int64, error)

func (*MicroBlockMessage) UnmarshalBinary added in v0.3.0

func (a *MicroBlockMessage) UnmarshalBinary(data []byte) error

func (*MicroBlockMessage) WriteTo added in v0.3.0

func (a *MicroBlockMessage) WriteTo(w io.Writer) (int64, error)

type MicroBlockRequestMessage added in v0.3.0

type MicroBlockRequestMessage struct {
	TotalBlockSig []byte
}

?? total block sig or id

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(_ io.Reader) (n int64, err error)

func (*MicroBlockRequestMessage) UnmarshalBinary added in v0.3.0

func (a *MicroBlockRequestMessage) UnmarshalBinary(data []byte) error

func (*MicroBlockRequestMessage) WriteTo added in v0.3.0

func (a *MicroBlockRequestMessage) WriteTo(w io.Writer) (int64, error)

type MicroblockTotalSig added in v0.3.0

type MicroblockTotalSig = crypto.Signature

type MiningLimits added in v0.6.0

type MiningLimits struct {
	MaxScriptRunsInBlock        int
	MaxScriptsComplexityInBlock int
	ClassicAmountOfTxsInBlock   int
	MaxTxsSizeInBytes           int
}

type NxtConsensus added in v0.3.0

type NxtConsensus struct {
	BaseTarget   uint64   `json:"base-target"`
	GenSignature B58Bytes `json:"generation-signature"`
}

func (*NxtConsensus) BinarySize added in v0.5.0

func (nc *NxtConsensus) BinarySize() int

type OptionalAsset

type OptionalAsset struct {
	Present bool
	ID      crypto.Digest
}

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) BinarySize added in v0.5.0

func (a OptionalAsset) BinarySize() int

func (OptionalAsset) Eq added in v0.5.0

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

func (OptionalAsset) WriteTo added in v0.3.0

func (a OptionalAsset) WriteTo(w io.Writer) (int64, error)

WriteTo writes its binary representation.

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
	GenerateID(scheme Scheme) error
	GetProofs() (*ProofsV1, error)
	Verify(Scheme, crypto.PublicKey) (bool, error)
	ToProtobuf(Scheme) *g.Order
	ToProtobufSigned(Scheme) *g.Order
	BinarySize() int
}

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 OrderToOrderBody(o Order) (OrderBody, error)

func (OrderBody) BinarySize added in v0.5.0

func (o OrderBody) BinarySize() int

func (OrderBody) GetSenderPK added in v0.3.0

func (o OrderBody) GetSenderPK() crypto.PublicKey

func (*OrderBody) Serialize added in v0.3.0

func (o *OrderBody) Serialize(s *serializer.Serializer) error

func (*OrderBody) SpendAsset added in v0.3.0

func (o *OrderBody) SpendAsset() OptionalAsset

func (OrderBody) ToProtobuf added in v0.5.0

func (o OrderBody) ToProtobuf(scheme Scheme) *g.Order

func (*OrderBody) UnmarshalBinary added in v0.5.0

func (o *OrderBody) UnmarshalBinary(data []byte) error

func (OrderBody) Valid added in v0.3.0

func (o OrderBody) Valid() (bool, error)

type OrderType

type OrderType byte

OrderType an alias for byte that encodes the type of OrderV1 (BUY|SELL).

const (
	Buy OrderType = iota
	Sell
)

iota: reset

func (OrderType) MarshalJSON

func (t OrderType) MarshalJSON() ([]byte, error)

MarshalJSON writes value of OrderType to JSON representation.

func (OrderType) String

func (t OrderType) String() string

func (OrderType) ToProtobuf added in v0.5.0

func (t OrderType) ToProtobuf() g.Order_Side

func (*OrderType) UnmarshalJSON

func (t *OrderType) UnmarshalJSON(value []byte) error

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) BinarySize added in v0.5.0

func (o OrderV1) BinarySize() int

func (OrderV1) BodyMarshalBinary added in v0.3.0

func (o OrderV1) BodyMarshalBinary() ([]byte, error)

func (OrderV1) BodySerialize added in v0.3.0

func (o OrderV1) BodySerialize(s *serializer.Serializer) error

func (*OrderV1) GenerateID added in v0.5.0

func (o *OrderV1) GenerateID(_ Scheme) error

func (OrderV1) GetAmount added in v0.3.0

func (o OrderV1) GetAmount() uint64

func (*OrderV1) GetAssetPair added in v0.3.0

func (o *OrderV1) GetAssetPair() AssetPair

func (*OrderV1) GetExpiration added in v0.3.0

func (o *OrderV1) GetExpiration() uint64

func (OrderV1) GetID added in v0.3.0

func (o OrderV1) GetID() ([]byte, error)

func (OrderV1) GetMatcherFee added in v0.3.0

func (o OrderV1) GetMatcherFee() uint64

func (OrderV1) GetMatcherFeeAsset added in v0.3.0

func (o OrderV1) GetMatcherFeeAsset() OptionalAsset

func (*OrderV1) GetMatcherPK added in v0.1.2

func (o *OrderV1) GetMatcherPK() crypto.PublicKey

func (*OrderV1) GetOrderType added in v0.1.2

func (o *OrderV1) GetOrderType() OrderType

func (*OrderV1) GetPrice added in v0.3.0

func (o *OrderV1) GetPrice() uint64

func (OrderV1) GetProofs added in v0.3.0

func (o OrderV1) GetProofs() (*ProofsV1, error)

func (OrderV1) GetTimestamp added in v0.3.0

func (o OrderV1) GetTimestamp() uint64

func (*OrderV1) GetVersion added in v0.1.2

func (o *OrderV1) GetVersion() byte

func (*OrderV1) MarshalBinary added in v0.1.2

func (o *OrderV1) MarshalBinary() ([]byte, error)

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) Sign added in v0.1.2

func (o *OrderV1) Sign(_ Scheme, secretKey crypto.SecretKey) error

Sign adds a signature to the order.

func (OrderV1) ToProtobuf added in v0.5.0

func (o OrderV1) ToProtobuf(scheme Scheme) *g.Order

func (OrderV1) ToProtobufSigned added in v0.5.0

func (o OrderV1) ToProtobufSigned(scheme Scheme) *g.Order

func (*OrderV1) UnmarshalBinary added in v0.1.2

func (o *OrderV1) UnmarshalBinary(data []byte) error

UnmarshalBinary reads an order from its binary representation.

func (*OrderV1) Verify added in v0.1.2

func (o *OrderV1) Verify(_ Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the order's signature is valid.

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) BinarySize added in v0.5.0

func (o OrderV2) BinarySize() int

func (OrderV2) BodyMarshalBinary added in v0.3.0

func (o OrderV2) BodyMarshalBinary() ([]byte, error)

func (*OrderV2) GenerateID added in v0.5.0

func (o *OrderV2) GenerateID(_ Scheme) error

func (OrderV2) GetAmount added in v0.3.0

func (o OrderV2) GetAmount() uint64

func (*OrderV2) GetAssetPair added in v0.3.0

func (o *OrderV2) GetAssetPair() AssetPair

func (*OrderV2) GetExpiration added in v0.3.0

func (o *OrderV2) GetExpiration() uint64

func (OrderV2) GetID added in v0.3.0

func (o OrderV2) GetID() ([]byte, error)

func (OrderV2) GetMatcherFee added in v0.3.0

func (o OrderV2) GetMatcherFee() uint64

func (OrderV2) GetMatcherFeeAsset added in v0.3.0

func (o OrderV2) GetMatcherFeeAsset() OptionalAsset

func (*OrderV2) GetMatcherPK added in v0.1.2

func (o *OrderV2) GetMatcherPK() crypto.PublicKey

func (*OrderV2) GetOrderType added in v0.1.2

func (o *OrderV2) GetOrderType() OrderType

func (*OrderV2) GetPrice added in v0.3.0

func (o *OrderV2) GetPrice() uint64

func (OrderV2) GetProofs added in v0.3.0

func (o OrderV2) GetProofs() (*ProofsV1, error)

func (OrderV2) GetTimestamp added in v0.3.0

func (o OrderV2) GetTimestamp() uint64

func (*OrderV2) GetVersion added in v0.1.2

func (o *OrderV2) GetVersion() byte

func (*OrderV2) MarshalBinary added in v0.1.2

func (o *OrderV2) MarshalBinary() ([]byte, error)

MarshalBinary writes order to its bytes representation.

func (*OrderV2) Sign added in v0.1.2

func (o *OrderV2) Sign(_ Scheme, secretKey crypto.SecretKey) error

Sign adds a signature to the order.

func (OrderV2) ToProtobuf added in v0.5.0

func (o OrderV2) ToProtobuf(scheme Scheme) *g.Order

func (OrderV2) ToProtobufSigned added in v0.5.0

func (o OrderV2) ToProtobufSigned(scheme Scheme) *g.Order

func (*OrderV2) UnmarshalBinary added in v0.1.2

func (o *OrderV2) UnmarshalBinary(data []byte) error

UnmarshalBinary reads an order from its binary representation.

func (*OrderV2) Verify added in v0.1.2

func (o *OrderV2) Verify(_ Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the order's signature is valid.

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) BinarySize added in v0.5.0

func (o OrderV3) BinarySize() int

func (*OrderV3) BodyMarshalBinary added in v0.3.0

func (o *OrderV3) BodyMarshalBinary() ([]byte, error)

func (*OrderV3) GenerateID added in v0.5.0

func (o *OrderV3) GenerateID(_ Scheme) error

func (OrderV3) GetAmount added in v0.3.0

func (o OrderV3) GetAmount() uint64

func (*OrderV3) GetAssetPair added in v0.3.0

func (o *OrderV3) GetAssetPair() AssetPair

func (*OrderV3) GetExpiration added in v0.3.0

func (o *OrderV3) GetExpiration() uint64

func (*OrderV3) GetID added in v0.3.0

func (o *OrderV3) GetID() ([]byte, error)

func (OrderV3) GetMatcherFee added in v0.3.0

func (o OrderV3) GetMatcherFee() uint64

func (OrderV3) GetMatcherFeeAsset added in v0.3.0

func (o OrderV3) GetMatcherFeeAsset() OptionalAsset

func (*OrderV3) GetMatcherPK added in v0.3.0

func (o *OrderV3) GetMatcherPK() crypto.PublicKey

func (*OrderV3) GetOrderType added in v0.3.0

func (o *OrderV3) GetOrderType() OrderType

func (*OrderV3) GetPrice added in v0.3.0

func (o *OrderV3) GetPrice() uint64

func (OrderV3) GetProofs added in v0.3.0

func (o OrderV3) GetProofs() (*ProofsV1, error)

func (OrderV3) GetTimestamp added in v0.3.0

func (o OrderV3) GetTimestamp() uint64

func (*OrderV3) GetVersion added in v0.3.0

func (o *OrderV3) GetVersion() byte

func (*OrderV3) MarshalBinary added in v0.3.0

func (o *OrderV3) MarshalBinary() ([]byte, error)

MarshalBinary writes order to its bytes representation.

func (*OrderV3) Sign added in v0.3.0

func (o *OrderV3) Sign(_ Scheme, secretKey crypto.SecretKey) error

Sign adds a signature to the order.

func (OrderV3) ToProtobuf added in v0.5.0

func (o OrderV3) ToProtobuf(scheme Scheme) *g.Order

func (OrderV3) ToProtobufSigned added in v0.5.0

func (o OrderV3) ToProtobufSigned(scheme Scheme) *g.Order

func (*OrderV3) UnmarshalBinary added in v0.3.0

func (o *OrderV3) UnmarshalBinary(data []byte) error

UnmarshalBinary reads an order from its binary representation.

func (*OrderV3) Verify added in v0.3.0

func (o *OrderV3) Verify(_ Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the order's signature is valid.

type OrderV4 added in v0.5.0

type OrderV4 struct {
	Version         byte           `json:"version"`
	ID              *crypto.Digest `json:"id,omitempty"`
	Proofs          *ProofsV1      `json:"proofs,omitempty"`
	MatcherFeeAsset OptionalAsset  `json:"matcherFeeAssetId"`
	OrderBody
}

OrderV4 is for Protobuf.

func NewUnsignedOrderV4 added in v0.5.0

func NewUnsignedOrderV4(senderPK, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64, matcherFeeAsset OptionalAsset) *OrderV4

NewUnsignedOrderV4 creates the new unsigned order.

func (OrderV4) BinarySize added in v0.5.0

func (o OrderV4) BinarySize() int

func (*OrderV4) BodyMarshalBinary added in v0.5.0

func (o *OrderV4) BodyMarshalBinary(scheme Scheme) ([]byte, error)

func (*OrderV4) GenerateID added in v0.5.0

func (o *OrderV4) GenerateID(scheme Scheme) error

func (OrderV4) GetAmount added in v0.5.0

func (o OrderV4) GetAmount() uint64

func (*OrderV4) GetAssetPair added in v0.5.0

func (o *OrderV4) GetAssetPair() AssetPair

func (*OrderV4) GetExpiration added in v0.5.0

func (o *OrderV4) GetExpiration() uint64

func (*OrderV4) GetID added in v0.5.0

func (o *OrderV4) GetID() ([]byte, error)

func (OrderV4) GetMatcherFee added in v0.5.0

func (o OrderV4) GetMatcherFee() uint64

func (OrderV4) GetMatcherFeeAsset added in v0.5.0

func (o OrderV4) GetMatcherFeeAsset() OptionalAsset

func (*OrderV4) GetMatcherPK added in v0.5.0

func (o *OrderV4) GetMatcherPK() crypto.PublicKey

func (*OrderV4) GetOrderType added in v0.5.0

func (o *OrderV4) GetOrderType() OrderType

func (*OrderV4) GetPrice added in v0.5.0

func (o *OrderV4) GetPrice() uint64

func (OrderV4) GetProofs added in v0.5.0

func (o OrderV4) GetProofs() (*ProofsV1, error)

func (OrderV4) GetTimestamp added in v0.5.0

func (o OrderV4) GetTimestamp() uint64

func (*OrderV4) GetVersion added in v0.5.0

func (o *OrderV4) GetVersion() byte

func (*OrderV4) Sign added in v0.5.0

func (o *OrderV4) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds a signature to the order.

func (OrderV4) ToProtobuf added in v0.5.0

func (o OrderV4) ToProtobuf(scheme Scheme) *g.Order

func (OrderV4) ToProtobufSigned added in v0.5.0

func (o OrderV4) ToProtobufSigned(scheme Scheme) *g.Order

func (*OrderV4) Verify added in v0.5.0

func (o *OrderV4) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the order's signature is valid.

type OrderVersion added in v0.2.0

type OrderVersion struct {
	Version byte `json:"version"`
}

type PBBlockMessage added in v0.5.0

type PBBlockMessage struct {
	PBBlockBytes []byte
}

PBBlockMessage represents Protobuf Block message

func (*PBBlockMessage) MarshalBinary added in v0.5.0

func (m *PBBlockMessage) MarshalBinary() ([]byte, error)

MarshalBinary encodes PBBlockMessage to binary form

func (*PBBlockMessage) ReadFrom added in v0.5.0

func (m *PBBlockMessage) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads PBBlockMessage from io.Reader

func (*PBBlockMessage) UnmarshalBinary added in v0.5.0

func (m *PBBlockMessage) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes PBBlockMessage from binary from

func (*PBBlockMessage) WriteTo added in v0.5.0

func (m *PBBlockMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes PBBlockMessage to io.Writer

type PBMicroBlockMessage added in v0.5.0

type PBMicroBlockMessage struct {
	MicroBlockBytes Bytes
}

PBMicroBlockMessage represents a Protobuf MicroBlock message.

func (*PBMicroBlockMessage) MarshalBinary added in v0.5.0

func (a *PBMicroBlockMessage) MarshalBinary() ([]byte, error)

func (*PBMicroBlockMessage) ReadFrom added in v0.5.0

func (*PBMicroBlockMessage) ReadFrom(_ io.Reader) (int64, error)

func (*PBMicroBlockMessage) UnmarshalBinary added in v0.5.0

func (a *PBMicroBlockMessage) UnmarshalBinary(data []byte) error

func (*PBMicroBlockMessage) WriteTo added in v0.5.0

func (a *PBMicroBlockMessage) WriteTo(w io.Writer) (int64, error)

type PBTransactionMessage added in v0.5.0

type PBTransactionMessage struct {
	Transaction []byte
}

PBTransactionMessage represents Protobuf TransactionsSend message

func (*PBTransactionMessage) MarshalBinary added in v0.5.0

func (m *PBTransactionMessage) MarshalBinary() ([]byte, error)

MarshalBinary encodes PBTransactionMessage to binary form

func (*PBTransactionMessage) ReadFrom added in v0.5.0

func (m *PBTransactionMessage) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads PBTransactionMessage from io.Reader

func (*PBTransactionMessage) UnmarshalBinary added in v0.5.0

func (m *PBTransactionMessage) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes PBTransactionMessage from binary form

func (*PBTransactionMessage) WriteTo added in v0.5.0

func (m *PBTransactionMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes PBTransactionMessage to io.Writer

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) BinarySize added in v0.5.0

func (tx Payment) BinarySize() int

func (*Payment) BodyMarshalBinary added in v0.3.0

func (tx *Payment) BodyMarshalBinary() ([]byte, error)

func (*Payment) GenerateID added in v0.3.0

func (tx *Payment) GenerateID(scheme Scheme) error

func (Payment) GetFee added in v0.3.0

func (tx Payment) GetFee() uint64

func (Payment) GetID added in v0.2.0

func (tx Payment) GetID(scheme Scheme) ([]byte, error)

func (Payment) GetSenderPK added in v0.3.0

func (tx Payment) GetSenderPK() crypto.PublicKey

func (Payment) GetTimestamp added in v0.3.0

func (tx Payment) GetTimestamp() uint64

func (Payment) GetTypeInfo added in v0.5.0

func (tx Payment) GetTypeInfo() TransactionTypeInfo

func (Payment) GetVersion added in v0.5.0

func (tx Payment) GetVersion() byte

func (*Payment) MarshalBinary

func (tx *Payment) MarshalBinary() ([]byte, error)

MarshalBinary returns a bytes representation of Payment transaction.

func (*Payment) MarshalBinary2 added in v0.3.0

func (tx *Payment) MarshalBinary2(buf []byte) ([]byte, error)

MarshalBinary returns a bytes representation of Payment transaction.

func (*Payment) MarshalSignedToProtobuf added in v0.5.0

func (tx *Payment) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*Payment) MarshalToProtobuf added in v0.5.0

func (tx *Payment) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*Payment) Sign

func (tx *Payment) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates transaction signature and set it as an ID.

func (*Payment) ToProtobuf added in v0.5.0

func (tx *Payment) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*Payment) ToProtobufSigned added in v0.5.0

func (tx *Payment) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*Payment) UnmarshalBinary

func (tx *Payment) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads Payment transaction from its binary representation.

func (*Payment) UnmarshalFromProtobuf added in v0.5.0

func (tx *Payment) UnmarshalFromProtobuf(data []byte) error

func (*Payment) UnmarshalJSON added in v0.5.0

func (tx *Payment) UnmarshalJSON(data []byte) error

func (*Payment) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *Payment) UnmarshalSignedFromProtobuf(data []byte) error

func (*Payment) Validate added in v0.8.0

func (tx *Payment) Validate() (Transaction, error)

func (*Payment) Verify

func (tx *Payment) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the Signature is valid for given public key.

type PeerInfo

type PeerInfo struct {
	Addr net.IP
	Port uint16
}

PeerInfo represents the address of a single peer

func NewPeerInfoFromString added in v0.3.0

func NewPeerInfoFromString(addr string) (PeerInfo, error)

func (*PeerInfo) Empty added in v0.3.0

func (p *PeerInfo) Empty() bool

func (*PeerInfo) MarshalBinary

func (p *PeerInfo) MarshalBinary() ([]byte, error)

MarshalBinary encodes PeerInfo message to binary form

func (PeerInfo) MarshalJSON

func (p PeerInfo) MarshalJSON() ([]byte, error)

MarshalJSON writes PeerInfo Value as JSON string

func (*PeerInfo) ReadFrom added in v0.3.0

func (p *PeerInfo) ReadFrom(r io.Reader) (int64, error)

func (PeerInfo) String added in v0.2.0

func (p PeerInfo) String() string

String() implements Stringer interface for PeerInfo

func (*PeerInfo) UnmarshalBinary

func (p *PeerInfo) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes PeerInfo message from binary form

func (*PeerInfo) UnmarshalJSON

func (p *PeerInfo) UnmarshalJSON(value []byte) error

UnmarshalJSON reads PeerInfo from JSON string

func (PeerInfo) WriteTo added in v0.3.0

func (p PeerInfo) WriteTo(w io.Writer) (int64, error)

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

func (*PeersMessage) WriteTo

func (m *PeersMessage) WriteTo(w io.Writer) (int64, error)

type ProofsV1

type ProofsV1 struct {
	Version byte
	Proofs  []B58Bytes
}

ProofsV1 is a collection of proofs.

func NewProofs added in v0.3.0

func NewProofs() *ProofsV1

func NewProofsFromSignature added in v0.5.0

func NewProofsFromSignature(sig *crypto.Signature) *ProofsV1

func (*ProofsV1) BinarySize added in v0.5.0

func (p *ProofsV1) BinarySize() int

func (ProofsV1) Bytes added in v0.5.0

func (p ProofsV1) Bytes() [][]byte

func (*ProofsV1) MarshalBinary

func (p *ProofsV1) MarshalBinary() ([]byte, error)

MarshalBinary writes the proofs to its binary form.

func (ProofsV1) MarshalJSON

func (p ProofsV1) MarshalJSON() ([]byte, error)

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) Sign

func (p *ProofsV1) Sign(pos int, key crypto.SecretKey, data []byte) error

Sign creates a signature and stores it as a proof at given position.

func (ProofsV1) String

func (p ProofsV1) String() string

String gives a string representation of the proofs collection.

func (*ProofsV1) UnmarshalBinary

func (p *ProofsV1) UnmarshalBinary(data []byte) error

UnmarshalBinary reads the proofs from its binary representation.

func (*ProofsV1) UnmarshalJSON

func (p *ProofsV1) UnmarshalJSON(value []byte) error

UnmarshalJSON reads the proofs from JSON.

func (*ProofsV1) Valid added in v0.8.8

func (p *ProofsV1) Valid() error

func (*ProofsV1) Verify

func (p *ProofsV1) Verify(pos int, key crypto.PublicKey, data []byte) (bool, error)

Verify checks that the proof at given position is a valid signature.

type ProtobufConverter added in v0.5.0

type ProtobufConverter struct {
	FallbackChainID byte
	// contains filtered or unexported fields
}

func (*ProtobufConverter) Address added in v0.5.0

func (c *ProtobufConverter) Address(scheme byte, addr []byte) (Address, error)

func (*ProtobufConverter) Block added in v0.5.0

func (c *ProtobufConverter) Block(block *g.Block) (Block, error)

func (*ProtobufConverter) BlockHeader added in v0.5.0

func (c *ProtobufConverter) BlockHeader(block *g.Block) (BlockHeader, error)

func (*ProtobufConverter) BlockTransactions added in v0.5.0

func (c *ProtobufConverter) BlockTransactions(block *g.Block) ([]Transaction, error)

func (*ProtobufConverter) BurnScriptActions added in v0.5.0

func (c *ProtobufConverter) BurnScriptActions(burns []*g.InvokeScriptResult_Burn) ([]*BurnScriptAction, error)

func (*ProtobufConverter) Entry added in v0.5.0

func (*ProtobufConverter) ErrorMessage added in v0.6.0

func (*ProtobufConverter) IssueScriptActions added in v0.5.0

func (c *ProtobufConverter) IssueScriptActions(issues []*g.InvokeScriptResult_Issue) ([]*IssueScriptAction, error)

func (*ProtobufConverter) MicroBlock added in v0.5.0

func (c *ProtobufConverter) MicroBlock(mb *g.SignedMicroBlock) (MicroBlock, error)

func (*ProtobufConverter) Recipient added in v0.5.0

func (c *ProtobufConverter) Recipient(scheme byte, recipient *g.Recipient) (Recipient, error)

func (*ProtobufConverter) ReissueScriptActions added in v0.5.0

func (c *ProtobufConverter) ReissueScriptActions(reissues []*g.InvokeScriptResult_Reissue) ([]*ReissueScriptAction, error)

func (*ProtobufConverter) SignedTransaction added in v0.5.0

func (c *ProtobufConverter) SignedTransaction(stx *g.SignedTransaction) (Transaction, error)

func (*ProtobufConverter) SignedTransactions added in v0.5.0

func (c *ProtobufConverter) SignedTransactions(txs []*g.SignedTransaction) ([]Transaction, error)

func (*ProtobufConverter) SponsorshipScriptActions added in v0.7.0

func (c *ProtobufConverter) SponsorshipScriptActions(sponsorships []*g.InvokeScriptResult_SponsorFee) ([]*SponsorshipScriptAction, error)

func (*ProtobufConverter) Transaction added in v0.5.0

func (c *ProtobufConverter) Transaction(tx *g.Transaction) (Transaction, error)

func (*ProtobufConverter) TransferScriptActions added in v0.5.0

func (c *ProtobufConverter) TransferScriptActions(scheme byte, payments []*g.InvokeScriptResult_Payment) ([]*TransferScriptAction, error)

type Recipient added in v0.2.0

type Recipient struct {
	Address *Address
	Alias   *Alias
	// contains filtered or unexported fields
}

Recipient could be an Alias or an Address.

func NewRecipientFromAddress added in v0.2.0

func NewRecipientFromAddress(a Address) Recipient

NewRecipientFromAddress creates the Recipient from given address.

func NewRecipientFromAlias added in v0.2.0

func NewRecipientFromAlias(a Alias) Recipient

NewRecipientFromAlias creates a Recipient with the given Alias inside.

func NewRecipientFromString added in v0.3.0

func NewRecipientFromString(s string) (Recipient, error)

func (*Recipient) BinarySize added in v0.5.0

func (r *Recipient) BinarySize() int

func (Recipient) Eq added in v0.5.0

func (r Recipient) Eq(r2 Recipient) bool

func (*Recipient) MarshalBinary added in v0.2.0

func (r *Recipient) MarshalBinary() ([]byte, error)

MarshalBinary makes bytes of the Recipient.

func (Recipient) MarshalJSON added in v0.2.0

func (r Recipient) MarshalJSON() ([]byte, error)

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) String added in v0.2.0

func (r *Recipient) String() string

String gives the string representation of the Recipient.

func (Recipient) ToProtobuf added in v0.5.0

func (r Recipient) ToProtobuf() (*g.Recipient, error)

func (*Recipient) UnmarshalBinary added in v0.2.0

func (r *Recipient) UnmarshalBinary(data []byte) error

UnmarshalBinary reads the Recipient from bytes. Validates the result.

func (*Recipient) UnmarshalJSON added in v0.2.0

func (r *Recipient) UnmarshalJSON(value []byte) error

UnmarshalJSON reads the Recipient from its JSON representation.

func (Recipient) Valid added in v0.3.0

func (r Recipient) Valid() (bool, error)

Valid checks that either an Address or an Alias is set then checks the validity of the set field.

func (*Recipient) WriteTo added in v0.3.0

func (r *Recipient) WriteTo(w io.Writer) (int64, error)

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) BinarySize added in v0.5.0

func (r Reissue) BinarySize() int

func (Reissue) GetFee added in v0.3.0

func (r Reissue) GetFee() uint64

func (Reissue) GetSenderPK added in v0.3.0

func (r Reissue) GetSenderPK() crypto.PublicKey

func (Reissue) GetTimestamp added in v0.3.0

func (r Reissue) GetTimestamp() uint64

func (Reissue) ToProtobuf added in v0.5.0

func (r Reissue) ToProtobuf() *g.Transaction_Reissue

func (*Reissue) UnmarshalBinary added in v0.5.0

func (r *Reissue) UnmarshalBinary(data []byte) error

func (Reissue) Valid added in v0.3.0

func (r Reissue) Valid() (bool, error)

type ReissueScriptAction added in v0.5.0

type ReissueScriptAction struct {
	AssetID    crypto.Digest // assetId
	Quantity   int64         // quantity
	Reissuable bool          // isReissuable
}

ReissueScriptAction is an action to emit Reissue transaction as a result of script invocation.

func (*ReissueScriptAction) ToProtobuf added in v0.5.0

type ReissueWithProofs added in v0.5.0

type ReissueWithProofs 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
}

ReissueWithProofs same as ReissueWithSig but version 2 with Proofs.

func NewUnsignedReissueWithProofs added in v0.5.0

func NewUnsignedReissueWithProofs(v, chainID byte, senderPK crypto.PublicKey, assetID crypto.Digest, quantity uint64, reissuable bool, timestamp, fee uint64) *ReissueWithProofs

NewUnsignedReissueWithProofs creates new ReissueWithProofs transaction without signature and ID.

func (ReissueWithProofs) BinarySize added in v0.5.0

func (tx ReissueWithProofs) BinarySize() int

func (*ReissueWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *ReissueWithProofs) BodyMarshalBinary() ([]byte, error)

func (*ReissueWithProofs) Clone added in v0.5.0

func (tx *ReissueWithProofs) Clone() *ReissueWithProofs

func (*ReissueWithProofs) GenerateID added in v0.5.0

func (tx *ReissueWithProofs) GenerateID(scheme Scheme) error

func (ReissueWithProofs) GetID added in v0.5.0

func (tx ReissueWithProofs) GetID(scheme Scheme) ([]byte, error)

func (ReissueWithProofs) GetTypeInfo added in v0.5.0

func (tx ReissueWithProofs) GetTypeInfo() TransactionTypeInfo

func (ReissueWithProofs) GetVersion added in v0.5.0

func (tx ReissueWithProofs) GetVersion() byte

func (*ReissueWithProofs) MarshalBinary added in v0.5.0

func (tx *ReissueWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes ReissueWithProofs transaction to its bytes representation.

func (*ReissueWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *ReissueWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*ReissueWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *ReissueWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*ReissueWithProofs) Sign added in v0.5.0

func (tx *ReissueWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*ReissueWithProofs) ToProtobuf added in v0.5.0

func (tx *ReissueWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*ReissueWithProofs) ToProtobufSigned added in v0.5.0

func (tx *ReissueWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*ReissueWithProofs) UnmarshalBinary added in v0.5.0

func (tx *ReissueWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads ReissueWithProofs from its bytes representation.

func (*ReissueWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *ReissueWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*ReissueWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *ReissueWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*ReissueWithProofs) Validate added in v0.8.0

func (tx *ReissueWithProofs) Validate() (Transaction, error)

func (*ReissueWithProofs) Verify added in v0.5.0

func (tx *ReissueWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type ReissueWithSig added in v0.5.0

type ReissueWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Reissue
}

ReissueWithSig is a transaction that allows to issue new amount of existing token, if it was issued as reissuable.

func NewUnsignedReissueWithSig added in v0.5.0

func NewUnsignedReissueWithSig(senderPK crypto.PublicKey, assetID crypto.Digest, quantity uint64, reissuable bool, timestamp, fee uint64) *ReissueWithSig

NewUnsignedReissueWithSig creates new ReissueWithSig transaction without signature and ID.

func (ReissueWithSig) BinarySize added in v0.5.0

func (tx ReissueWithSig) BinarySize() int

func (*ReissueWithSig) BodyMarshalBinary added in v0.5.0

func (tx *ReissueWithSig) BodyMarshalBinary() ([]byte, error)

func (*ReissueWithSig) Clone added in v0.5.0

func (tx *ReissueWithSig) Clone() *ReissueWithSig

func (*ReissueWithSig) GenerateID added in v0.5.0

func (tx *ReissueWithSig) GenerateID(scheme Scheme) error

func (ReissueWithSig) GetID added in v0.5.0

func (tx ReissueWithSig) GetID(scheme Scheme) ([]byte, error)

func (ReissueWithSig) GetTypeInfo added in v0.5.0

func (tx ReissueWithSig) GetTypeInfo() TransactionTypeInfo

func (ReissueWithSig) GetVersion added in v0.5.0

func (tx ReissueWithSig) GetVersion() byte

func (*ReissueWithSig) MarshalBinary added in v0.5.0

func (tx *ReissueWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*ReissueWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *ReissueWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*ReissueWithSig) MarshalToProtobuf added in v0.5.0

func (tx *ReissueWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*ReissueWithSig) Sign added in v0.5.0

func (tx *ReissueWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

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 (*ReissueWithSig) ToProtobuf added in v0.5.0

func (tx *ReissueWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*ReissueWithSig) ToProtobufSigned added in v0.5.0

func (tx *ReissueWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*ReissueWithSig) UnmarshalBinary added in v0.5.0

func (tx *ReissueWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction from its binary representation.

func (*ReissueWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *ReissueWithSig) UnmarshalFromProtobuf(data []byte) error

func (*ReissueWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *ReissueWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*ReissueWithSig) Validate added in v0.8.0

func (tx *ReissueWithSig) Validate() (Transaction, error)

func (*ReissueWithSig) Verify added in v0.5.0

func (tx *ReissueWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that the signature of the transaction is valid for given public key.

type Scheme added in v0.3.0

type Scheme = byte

type Score added in v0.3.0

type Score = big.Int

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

func (*ScoreMessage) WriteTo

func (m *ScoreMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes ScoreMessage to io.Writer

type Script

type Script []byte

func (Script) IsValidChecksum added in v0.8.0

func (s Script) IsValidChecksum() bool

func (Script) MarshalJSON added in v0.2.0

func (s Script) MarshalJSON() ([]byte, error)

MarshalJSON writes Script as JSON

func (Script) String added in v0.2.0

func (s Script) String() string

String gives a string representation of Script bytes, script bytes encoded as BASE64 with prefix

func (*Script) UnmarshalJSON added in v0.2.0

func (s *Script) UnmarshalJSON(value []byte) error

UnmarshalJSON reads Script from it's JSON representation

type ScriptAction added in v0.5.0

type ScriptAction interface {
	// contains filtered or unexported methods
}

ScriptAction common interface of script invocation actions.

type ScriptErrorMessage added in v0.6.0

type ScriptErrorMessage struct {
	Code TxFailureReason
	Text string
}

func (*ScriptErrorMessage) ToProtobuf added in v0.6.0

type ScriptInfo added in v0.5.0

type ScriptInfo struct {
	Version    int32
	Bytes      []byte
	Base64     string
	Complexity uint64
}

func (*ScriptInfo) ToProtobuf added in v0.5.0

func (s *ScriptInfo) ToProtobuf() *pb.ScriptData

type ScriptPayment added in v0.3.0

type ScriptPayment struct {
	Amount uint64        `json:"amount"`
	Asset  OptionalAsset `json:"assetId"`
}

ScriptPayment part of InvokeScriptTransaction that describes attached payments that comes in with invoke.

func (*ScriptPayment) BinarySize added in v0.5.0

func (p *ScriptPayment) BinarySize() int

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

ScriptPayments list of payments attached to InvokeScriptTransaction.

func (*ScriptPayments) Append added in v0.3.0

func (sps *ScriptPayments) Append(sp ScriptPayment)

func (ScriptPayments) BinarySize added in v0.5.0

func (sps ScriptPayments) BinarySize() int

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 {
	DataEntries  []*DataEntryScriptAction
	Transfers    []*TransferScriptAction
	Issues       []*IssueScriptAction
	Reissues     []*ReissueScriptAction
	Burns        []*BurnScriptAction
	Sponsorships []*SponsorshipScriptAction
	ErrorMsg     ScriptErrorMessage
}

func NewScriptResult added in v0.5.0

func NewScriptResult(actions []ScriptAction, msg ScriptErrorMessage) (*ScriptResult, error)

NewScriptResult creates correct representation of invocation actions for storage and API.

func (*ScriptResult) FromProtobuf added in v0.5.0

func (sr *ScriptResult) FromProtobuf(scheme byte, msg *g.InvokeScriptResult) error

func (*ScriptResult) ToProtobuf added in v0.5.0

func (sr *ScriptResult) ToProtobuf() (*g.InvokeScriptResult, error)

type SetAssetScriptWithProofs added in v0.5.0

type SetAssetScriptWithProofs 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"`
}

SetAssetScriptWithProofs is a transaction to set smart script on an asset.

func NewUnsignedSetAssetScriptWithProofs added in v0.5.0

func NewUnsignedSetAssetScriptWithProofs(v, chain byte, senderPK crypto.PublicKey, assetID crypto.Digest, script []byte, fee, timestamp uint64) *SetAssetScriptWithProofs

NewUnsignedSetAssetScriptWithProofs creates new unsigned SetAssetScriptWithProofs transaction.

func (SetAssetScriptWithProofs) BinarySize added in v0.5.0

func (tx SetAssetScriptWithProofs) BinarySize() int

func (*SetAssetScriptWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *SetAssetScriptWithProofs) BodyMarshalBinary() ([]byte, error)

func (*SetAssetScriptWithProofs) Clone added in v0.5.0

func (*SetAssetScriptWithProofs) GenerateID added in v0.5.0

func (tx *SetAssetScriptWithProofs) GenerateID(scheme Scheme) error

func (SetAssetScriptWithProofs) GetFee added in v0.5.0

func (tx SetAssetScriptWithProofs) GetFee() uint64

func (SetAssetScriptWithProofs) GetID added in v0.5.0

func (tx SetAssetScriptWithProofs) GetID(scheme Scheme) ([]byte, error)

func (SetAssetScriptWithProofs) GetSenderPK added in v0.5.0

func (tx SetAssetScriptWithProofs) GetSenderPK() crypto.PublicKey

func (SetAssetScriptWithProofs) GetTimestamp added in v0.5.0

func (tx SetAssetScriptWithProofs) GetTimestamp() uint64

func (SetAssetScriptWithProofs) GetTypeInfo added in v0.5.0

func (SetAssetScriptWithProofs) GetVersion added in v0.5.0

func (tx SetAssetScriptWithProofs) GetVersion() byte

func (*SetAssetScriptWithProofs) MarshalBinary added in v0.5.0

func (tx *SetAssetScriptWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes SetAssetScriptWithProofs transaction to its bytes representation.

func (*SetAssetScriptWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *SetAssetScriptWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*SetAssetScriptWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *SetAssetScriptWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*SetAssetScriptWithProofs) NonEmptyScript added in v0.5.0

func (tx *SetAssetScriptWithProofs) NonEmptyScript() bool

NonEmptyScript returns true if transaction contains non-empty script.

func (*SetAssetScriptWithProofs) Sign added in v0.5.0

func (tx *SetAssetScriptWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*SetAssetScriptWithProofs) ToProtobuf added in v0.5.0

func (tx *SetAssetScriptWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*SetAssetScriptWithProofs) ToProtobufSigned added in v0.5.0

func (tx *SetAssetScriptWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*SetAssetScriptWithProofs) UnmarshalBinary added in v0.5.0

func (tx *SetAssetScriptWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads SetAssetScriptWithProofs transaction from its binary representation.

func (*SetAssetScriptWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *SetAssetScriptWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*SetAssetScriptWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *SetAssetScriptWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*SetAssetScriptWithProofs) Validate added in v0.8.0

func (tx *SetAssetScriptWithProofs) Validate() (Transaction, error)

func (*SetAssetScriptWithProofs) Verify added in v0.5.0

func (tx *SetAssetScriptWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type SetScriptWithProofs added in v0.5.0

type SetScriptWithProofs 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"`
}

SetScriptWithProofs is a transaction to set smart script on an account.

func NewUnsignedSetScriptWithProofs added in v0.5.0

func NewUnsignedSetScriptWithProofs(v byte, chain byte, senderPK crypto.PublicKey, script []byte, fee, timestamp uint64) *SetScriptWithProofs

NewUnsignedSetScriptWithProofs creates new unsigned SetScriptWithProofs transaction.

func (SetScriptWithProofs) BinarySize added in v0.5.0

func (tx SetScriptWithProofs) BinarySize() int

func (*SetScriptWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *SetScriptWithProofs) BodyMarshalBinary() ([]byte, error)

func (*SetScriptWithProofs) GenerateID added in v0.5.0

func (tx *SetScriptWithProofs) GenerateID(scheme Scheme) error

func (SetScriptWithProofs) GetFee added in v0.5.0

func (tx SetScriptWithProofs) GetFee() uint64

func (SetScriptWithProofs) GetID added in v0.5.0

func (tx SetScriptWithProofs) GetID(scheme Scheme) ([]byte, error)

func (SetScriptWithProofs) GetSenderPK added in v0.5.0

func (tx SetScriptWithProofs) GetSenderPK() crypto.PublicKey

func (SetScriptWithProofs) GetTimestamp added in v0.5.0

func (tx SetScriptWithProofs) GetTimestamp() uint64

func (SetScriptWithProofs) GetTypeInfo added in v0.5.0

func (tx SetScriptWithProofs) GetTypeInfo() TransactionTypeInfo

func (SetScriptWithProofs) GetVersion added in v0.5.0

func (tx SetScriptWithProofs) GetVersion() byte

func (*SetScriptWithProofs) MarshalBinary added in v0.5.0

func (tx *SetScriptWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes SetScriptWithProofs transaction to its bytes representation.

func (*SetScriptWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *SetScriptWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*SetScriptWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *SetScriptWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*SetScriptWithProofs) NonEmptyScript added in v0.5.0

func (tx *SetScriptWithProofs) NonEmptyScript() bool

NonEmptyScript returns true if transaction contains non-empty script.

func (*SetScriptWithProofs) Sign added in v0.5.0

func (tx *SetScriptWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*SetScriptWithProofs) ToProtobuf added in v0.5.0

func (tx *SetScriptWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*SetScriptWithProofs) ToProtobufSigned added in v0.5.0

func (tx *SetScriptWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*SetScriptWithProofs) UnmarshalBinary added in v0.5.0

func (tx *SetScriptWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads SetScriptWithProofs transaction from its binary representation.

func (*SetScriptWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *SetScriptWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*SetScriptWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *SetScriptWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*SetScriptWithProofs) Validate added in v0.8.0

func (tx *SetScriptWithProofs) Validate() (Transaction, error)

func (*SetScriptWithProofs) Verify added in v0.5.0

func (tx *SetScriptWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type SignaturesMessage

type SignaturesMessage struct {
	Signatures []crypto.Signature
}

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

func (*SignaturesMessage) WriteTo

func (m *SignaturesMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes SignaturesMessage to binary form

type SponsorshipScriptAction added in v0.7.0

type SponsorshipScriptAction struct {
	AssetID crypto.Digest // assetId
	MinFee  int64         // minSponsoredAssetFee
}

SponsorshipScriptAction is an action to set sponsorship for given asset in response to script invocation.

func (*SponsorshipScriptAction) ToProtobuf added in v0.7.0

type SponsorshipWithProofs added in v0.5.0

type SponsorshipWithProofs 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"`
}

SponsorshipWithProofs is a transaction to setup fee sponsorship for an asset.

func NewUnsignedSponsorshipWithProofs added in v0.5.0

func NewUnsignedSponsorshipWithProofs(v byte, senderPK crypto.PublicKey, assetID crypto.Digest, minAssetFee, fee, timestamp uint64) *SponsorshipWithProofs

NewUnsignedSponsorshipWithProofs creates new unsigned SponsorshipWithProofs transaction

func (SponsorshipWithProofs) BinarySize added in v0.5.0

func (tx SponsorshipWithProofs) BinarySize() int

func (*SponsorshipWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *SponsorshipWithProofs) BodyMarshalBinary() ([]byte, error)

func (*SponsorshipWithProofs) Clone added in v0.5.0

func (*SponsorshipWithProofs) GenerateID added in v0.5.0

func (tx *SponsorshipWithProofs) GenerateID(scheme Scheme) error

func (SponsorshipWithProofs) GetFee added in v0.5.0

func (tx SponsorshipWithProofs) GetFee() uint64

func (SponsorshipWithProofs) GetID added in v0.5.0

func (tx SponsorshipWithProofs) GetID(scheme Scheme) ([]byte, error)

func (SponsorshipWithProofs) GetSenderPK added in v0.5.0

func (tx SponsorshipWithProofs) GetSenderPK() crypto.PublicKey

func (SponsorshipWithProofs) GetTimestamp added in v0.5.0

func (tx SponsorshipWithProofs) GetTimestamp() uint64

func (SponsorshipWithProofs) GetTypeInfo added in v0.5.0

func (tx SponsorshipWithProofs) GetTypeInfo() TransactionTypeInfo

func (SponsorshipWithProofs) GetVersion added in v0.5.0

func (tx SponsorshipWithProofs) GetVersion() byte

func (*SponsorshipWithProofs) MarshalBinary added in v0.5.0

func (tx *SponsorshipWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes SponsorshipWithProofs transaction to its bytes representation.

func (*SponsorshipWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *SponsorshipWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*SponsorshipWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *SponsorshipWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*SponsorshipWithProofs) Sign added in v0.5.0

func (tx *SponsorshipWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*SponsorshipWithProofs) ToProtobuf added in v0.5.0

func (tx *SponsorshipWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*SponsorshipWithProofs) ToProtobufSigned added in v0.5.0

func (tx *SponsorshipWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*SponsorshipWithProofs) UnmarshalBinary added in v0.5.0

func (tx *SponsorshipWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads SponsorshipWithProofs from its bytes representation.

func (*SponsorshipWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *SponsorshipWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*SponsorshipWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *SponsorshipWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*SponsorshipWithProofs) Validate added in v0.8.0

func (tx *SponsorshipWithProofs) Validate() (Transaction, error)

func (*SponsorshipWithProofs) Verify added in v0.5.0

func (tx *SponsorshipWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type StateHash added in v0.6.0

type StateHash struct {
	BlockID BlockID
	SumHash crypto.Digest
	FieldsHashes
}

func (*StateHash) GenerateSumHash added in v0.6.0

func (s *StateHash) GenerateSumHash(prevSumHash []byte) error

func (*StateHash) MarshalBinary added in v0.6.0

func (s *StateHash) MarshalBinary() []byte

func (StateHash) MarshalJSON added in v0.6.0

func (s StateHash) MarshalJSON() ([]byte, error)

func (*StateHash) UnmarshalBinary added in v0.6.0

func (s *StateHash) UnmarshalBinary(data []byte) error

func (*StateHash) UnmarshalJSON added in v0.6.0

func (s *StateHash) UnmarshalJSON(value []byte) 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) BinarySize added in v0.5.0

func (a StringArgument) BinarySize() int

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

type StringDataEntry struct {
	Key   string
	Value string
}

StringDataEntry structure is a key-value pair to store a string value.

func (StringDataEntry) BinarySize added in v0.5.0

func (e StringDataEntry) BinarySize() int

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) ToProtobuf added in v0.5.0

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(version byte) error

type TCPAddr added in v0.3.0

type TCPAddr net.TCPAddr

func NewTCPAddr added in v0.3.0

func NewTCPAddr(ip net.IP, port int) TCPAddr

func NewTCPAddrFromString added in v0.3.0

func NewTCPAddrFromString(s string) TCPAddr

func NewTcpAddrFromUint64 added in v0.8.1

func NewTcpAddrFromUint64(value uint64) TCPAddr

func (TCPAddr) Empty added in v0.3.0

func (a TCPAddr) Empty() bool

func (TCPAddr) Equal added in v0.8.1

func (a TCPAddr) Equal(other TCPAddr) bool

Equal checks if ip address and port are equal.

func (TCPAddr) String added in v0.3.0

func (a TCPAddr) String() string

func (TCPAddr) ToIpPort added in v0.3.0

func (a TCPAddr) ToIpPort() IpPort

func (TCPAddr) ToUint64 added in v0.8.1

func (a TCPAddr) ToUint64() uint64

ToStaticSize converts TCPAddr to 8-byte array.

func (TCPAddr) WriteTo added in v0.3.0

func (a TCPAddr) WriteTo(w io.Writer) (int64, error)

type Timestamp added in v0.3.0

type Timestamp = uint64

type Transaction added in v0.1.2

type Transaction interface {

	// GetTypeInfo() returns information which describes which Golang structure
	// do we deal with (tx type + proof/signature flag).
	// <TODO>:
	// This is temporary workaround until we have the same struct for both
	// Signature and Proofs transactions.
	GetTypeInfo() TransactionTypeInfo
	GetVersion() byte
	GetID(scheme Scheme) ([]byte, error)
	GetSenderPK() crypto.PublicKey
	GetFee() uint64
	GetTimestamp() uint64

	// Check that all transaction fields are valid.
	// This includes ranges checks, and sanity checks specific for each transaction type:
	// for example, negative amounts for transfers.
	Validate() (Transaction, error)

	// Set transaction ID.
	// For most transacions ID is hash of transaction body.
	// For Payment transactions ID is Signature.
	GenerateID(scheme Scheme) error
	// Sign transaction with given secret key.
	// It also sets transaction ID.
	Sign(scheme Scheme, sk crypto.SecretKey) error

	// Functions for custom binary format.
	// Serialization.
	// MarshalBinary() is analogous to MarshalSignedToProtobuf() for Protobuf.
	MarshalBinary() ([]byte, error)
	// Parsing.
	UnmarshalBinary([]byte, Scheme) error
	// Bytes without signature.
	// BodyMarshalBinary() is analogous to MarshalToProtobuf() for Protobuf.
	BodyMarshalBinary() ([]byte, error)
	// Size in bytes in binary format.
	BinarySize() int

	// Protobuf-related functions.
	// Conversion to/from Protobuf wire byte format.
	MarshalToProtobuf(scheme Scheme) ([]byte, error)
	UnmarshalFromProtobuf([]byte) error
	MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)
	UnmarshalSignedFromProtobuf([]byte) error
	// Conversion to Protobuf types.
	ToProtobuf(scheme Scheme) (*g.Transaction, error)
	ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)
}

Transaction is a set of common transaction functions.

func BytesToTransaction added in v0.2.0

func BytesToTransaction(tx []byte, scheme Scheme) (Transaction, error)

func BytesToTransactions added in v0.3.0

func BytesToTransactions(count int, txs []byte, scheme Scheme) ([]Transaction, error)

func GuessTransactionType added in v0.3.0

func GuessTransactionType(t *TransactionTypeVersion) (Transaction, error)

Guess transaction from type and version

func SignedTxFromProtobuf added in v0.5.0

func SignedTxFromProtobuf(data []byte) (Transaction, error)

func TxFromProtobuf added in v0.5.0

func TxFromProtobuf(data []byte) (Transaction, error)

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

func (*TransactionMessage) WriteTo

func (m *TransactionMessage) WriteTo(w io.Writer) (int64, error)

WriteTo writes TransactionMessage to io.Writer

type TransactionProofVersion added in v0.5.0

type TransactionProofVersion byte
const (
	Signature TransactionProofVersion = iota + 1
	Proof
)

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
	UpdateAssetInfoTransaction                            // 17 - UpdateAssetInfoTransaction
)

All transaction types supported.

type TransactionTypeInfo added in v0.5.0

type TransactionTypeInfo struct {
	Type         TransactionType
	ProofVersion TransactionProofVersion
}

func (TransactionTypeInfo) String added in v0.8.0

func (a TransactionTypeInfo) String() string

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 NewTransactionsFromBytes added in v0.5.0

func NewTransactionsFromBytes(data []byte, count int, scheme Scheme) (Transactions, error)

func (Transactions) BinarySize added in v0.5.0

func (a Transactions) BinarySize() int

func (Transactions) Count added in v0.3.0

func (a Transactions) Count() int

func (Transactions) Join added in v0.5.0

func (a Transactions) Join(other Transactions) Transactions

func (Transactions) MarshalBinary added in v0.5.0

func (a Transactions) MarshalBinary() ([]byte, error)

func (Transactions) MarshalJSON added in v0.5.0

func (a Transactions) MarshalJSON() ([]byte, error)

func (Transactions) ToProtobuf added in v0.5.0

func (a Transactions) ToProtobuf(scheme Scheme) ([]*g.SignedTransaction, error)

func (*Transactions) UnmarshalFromProtobuf added in v0.5.0

func (a *Transactions) UnmarshalFromProtobuf(data []byte) error

func (*Transactions) UnmarshalJSON added in v0.5.0

func (a *Transactions) UnmarshalJSON(data []byte) error

func (Transactions) WriteTo added in v0.3.0

func (a Transactions) WriteTo(proto bool, scheme Scheme, w io.Writer) (int64, error)

func (Transactions) WriteToBinary added in v0.8.0

func (a Transactions) WriteToBinary(w io.Writer) (int64, 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) BinarySize added in v0.5.0

func (tr Transfer) BinarySize() int

func (Transfer) GetAttachment added in v0.8.0

func (tr Transfer) GetAttachment() []byte

func (Transfer) GetFee added in v0.3.0

func (tr Transfer) GetFee() uint64

func (Transfer) GetSenderPK added in v0.3.0

func (tr Transfer) GetSenderPK() crypto.PublicKey

func (Transfer) GetTimestamp added in v0.3.0

func (tr Transfer) GetTimestamp() uint64

func (*Transfer) Serialize added in v0.3.0

func (tr *Transfer) Serialize(s *serializer.Serializer) error

func (*Transfer) ToProtobuf added in v0.5.0

func (tr *Transfer) ToProtobuf() (*g.Transaction_Transfer, error)

func (*Transfer) UnmarshalBinary added in v0.5.0

func (tr *Transfer) UnmarshalBinary(data []byte) error

func (Transfer) Valid added in v0.3.0

func (tr Transfer) Valid() (bool, error)

type TransferScriptAction added in v0.5.0

type TransferScriptAction struct {
	Recipient Recipient
	Amount    int64
	Asset     OptionalAsset
}

TransferScriptAction is an action to emit transfer of asset.

func (*TransferScriptAction) ToProtobuf added in v0.5.0

type TransferWithProofs added in v0.5.0

type TransferWithProofs struct {
	Type    TransactionType `json:"type"`
	Version byte            `json:"version,omitempty"`
	ID      *crypto.Digest  `json:"id,omitempty"`
	Proofs  *ProofsV1       `json:"proofs,omitempty"`
	Transfer
}

TransferWithProofs transaction to transfer any token from one account to another. Version 2.

func NewUnsignedTransferWithProofs added in v0.5.0

func NewUnsignedTransferWithProofs(v byte, senderPK crypto.PublicKey, amountAsset, feeAsset OptionalAsset, timestamp, amount, fee uint64, recipient Recipient, attachment Attachment) *TransferWithProofs

NewUnsignedTransferWithProofs creates new TransferWithProofs transaction without proofs and ID.

func (TransferWithProofs) BinarySize added in v0.5.0

func (tx TransferWithProofs) BinarySize() int

func (*TransferWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *TransferWithProofs) BodyMarshalBinary() ([]byte, error)

func (*TransferWithProofs) BodySerialize added in v0.5.0

func (tx *TransferWithProofs) BodySerialize(s *serializer.Serializer) error

func (*TransferWithProofs) BodyUnmarshalBinary added in v0.5.0

func (tx *TransferWithProofs) BodyUnmarshalBinary(data []byte) error

func (*TransferWithProofs) Clone added in v0.5.0

func (*TransferWithProofs) GenerateID added in v0.5.0

func (tx *TransferWithProofs) GenerateID(scheme Scheme) error

func (TransferWithProofs) GetID added in v0.5.0

func (tx TransferWithProofs) GetID(scheme Scheme) ([]byte, error)

func (TransferWithProofs) GetProofs added in v0.8.0

func (tx TransferWithProofs) GetProofs() *ProofsV1

func (TransferWithProofs) GetTypeInfo added in v0.5.0

func (tx TransferWithProofs) GetTypeInfo() TransactionTypeInfo

func (TransferWithProofs) GetVersion added in v0.5.0

func (tx TransferWithProofs) GetVersion() byte

func (*TransferWithProofs) MarshalBinary added in v0.5.0

func (tx *TransferWithProofs) MarshalBinary() ([]byte, error)

MarshalBinary writes TransferWithProofs transaction to its bytes representation.

func (*TransferWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *TransferWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*TransferWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *TransferWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*TransferWithProofs) Serialize added in v0.5.0

func (tx *TransferWithProofs) Serialize(s *serializer.Serializer) error

func (*TransferWithProofs) Sign added in v0.5.0

func (tx *TransferWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign adds signature as a proof at first position.

func (*TransferWithProofs) ToProtobuf added in v0.5.0

func (tx *TransferWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*TransferWithProofs) ToProtobufSigned added in v0.5.0

func (tx *TransferWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*TransferWithProofs) UnmarshalBinary added in v0.5.0

func (tx *TransferWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads TransferWithProofs from its bytes representation.

func (*TransferWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *TransferWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*TransferWithProofs) UnmarshalJSON added in v0.5.0

func (tx *TransferWithProofs) UnmarshalJSON(data []byte) error

func (*TransferWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *TransferWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*TransferWithProofs) Validate added in v0.8.0

func (tx *TransferWithProofs) Validate() (Transaction, error)

func (*TransferWithProofs) Verify added in v0.5.0

func (tx *TransferWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify checks that first proof is a valid signature.

type TransferWithSig added in v0.5.0

type TransferWithSig struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Digest    `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Transfer
}

TransferWithSig transaction to transfer any token from one account to another. Version 1.

func NewUnsignedTransferWithSig added in v0.5.0

func NewUnsignedTransferWithSig(senderPK crypto.PublicKey, amountAsset, feeAsset OptionalAsset, timestamp, amount, fee uint64, recipient Recipient, attachment Attachment) *TransferWithSig

NewUnsignedTransferWithSig creates new TransferWithSig transaction without signature and ID.

func (TransferWithSig) BinarySize added in v0.5.0

func (tx TransferWithSig) BinarySize() int

func (*TransferWithSig) BodyMarshalBinary added in v0.5.0

func (tx *TransferWithSig) BodyMarshalBinary() ([]byte, error)

func (*TransferWithSig) BodySerialize added in v0.5.0

func (tx *TransferWithSig) BodySerialize(s *serializer.Serializer) error

func (*TransferWithSig) Clone added in v0.5.0

func (tx *TransferWithSig) Clone() *TransferWithSig

func (*TransferWithSig) GenerateID added in v0.5.0

func (tx *TransferWithSig) GenerateID(scheme Scheme) error

func (TransferWithSig) GetID added in v0.5.0

func (tx TransferWithSig) GetID(scheme Scheme) ([]byte, error)

func (TransferWithSig) GetProofs added in v0.8.0

func (tx TransferWithSig) GetProofs() *ProofsV1

func (TransferWithSig) GetTypeInfo added in v0.5.0

func (tx TransferWithSig) GetTypeInfo() TransactionTypeInfo

func (TransferWithSig) GetVersion added in v0.5.0

func (tx TransferWithSig) GetVersion() byte

func (*TransferWithSig) MarshalBinary added in v0.5.0

func (tx *TransferWithSig) MarshalBinary() ([]byte, error)

MarshalBinary saves transaction to its binary representation.

func (*TransferWithSig) MarshalSignedToProtobuf added in v0.5.0

func (tx *TransferWithSig) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*TransferWithSig) MarshalToProtobuf added in v0.5.0

func (tx *TransferWithSig) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*TransferWithSig) Serialize added in v0.5.0

func (tx *TransferWithSig) Serialize(s *serializer.Serializer) error

func (*TransferWithSig) Sign added in v0.5.0

func (tx *TransferWithSig) Sign(scheme Scheme, secretKey crypto.SecretKey) error

Sign calculates a signature and a digest as an ID of the transaction.

func (*TransferWithSig) ToProtobuf added in v0.5.0

func (tx *TransferWithSig) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*TransferWithSig) ToProtobufSigned added in v0.5.0

func (tx *TransferWithSig) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*TransferWithSig) UnmarshalBinary added in v0.5.0

func (tx *TransferWithSig) UnmarshalBinary(data []byte, scheme Scheme) error

UnmarshalBinary reads transaction from its binary representation.

func (*TransferWithSig) UnmarshalFromProtobuf added in v0.5.0

func (tx *TransferWithSig) UnmarshalFromProtobuf(data []byte) error

func (*TransferWithSig) UnmarshalJSON added in v0.5.0

func (tx *TransferWithSig) UnmarshalJSON(data []byte) error

func (*TransferWithSig) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *TransferWithSig) UnmarshalSignedFromProtobuf(data []byte) error

func (*TransferWithSig) Validate added in v0.8.0

func (tx *TransferWithSig) Validate() (Transaction, error)

func (*TransferWithSig) Verify added in v0.5.0

func (tx *TransferWithSig) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

Verify use given public key to verify that the signature is valid.

func (*TransferWithSig) WriteTo added in v0.5.0

func (tx *TransferWithSig) WriteTo(w io.Writer) (int64, error)

type TxFailureReason added in v0.7.0

type TxFailureReason byte

Transactions failure reasons.

const (
	DAppError TxFailureReason = iota + 1
	InsufficientActionsFee
	SmartAssetOnActionFailure
	SmartAssetOnPaymentFailure
)

type U32 added in v0.3.0

type U32 uint32

func (*U32) ReadFrom added in v0.3.0

func (a *U32) ReadFrom(r io.Reader) (int64, error)

func (U32) WriteTo added in v0.3.0

func (a U32) WriteTo(w io.Writer) (int64, error)

type U64 added in v0.3.0

type U64 uint64

func (*U64) ReadFrom added in v0.3.0

func (a *U64) ReadFrom(r io.Reader) (int64, error)

func (U64) WriteTo added in v0.3.0

func (a U64) WriteTo(w io.Writer) (int64, error)

type U8String added in v0.3.0

type U8String struct {
	S string
}

func NewU8String added in v0.3.0

func NewU8String(s string) U8String

func (U8String) MarshalBinary added in v0.3.0

func (a U8String) MarshalBinary() ([]byte, error)

MarshalBinary encodes U8String to binary form

func (*U8String) ReadFrom added in v0.3.0

func (a *U8String) ReadFrom(r io.Reader) (int64, error)

func (U8String) WriteTo added in v0.3.0

func (a U8String) WriteTo(w io.Writer) (int64, error)

MarshalBinary encodes U8String to binary form

type UpdateAssetInfoWithProofs added in v0.5.0

type UpdateAssetInfoWithProofs struct {
	Type        TransactionType  `json:"type"`
	Version     byte             `json:"version,omitempty"`
	ID          *crypto.Digest   `json:"id,omitempty"`
	Proofs      *ProofsV1        `json:"proofs,omitempty"`
	ChainID     byte             `json:"chainId"`
	SenderPK    crypto.PublicKey `json:"senderPublicKey"`
	AssetID     crypto.Digest    `json:"assetId"`
	Name        string           `json:"name"`
	Description string           `json:"description"`
	FeeAsset    OptionalAsset    `json:"feeAssetId"`
	Fee         uint64           `json:"fee"`
	Timestamp   uint64           `json:"timestamp,omitempty"`
}

func NewUnsignedUpdateAssetInfoWithProofs added in v0.5.0

func NewUnsignedUpdateAssetInfoWithProofs(v, chainID byte, assetID crypto.Digest, senderPK crypto.PublicKey, name, description string, timestamp uint64, feeAsset OptionalAsset, fee uint64) *UpdateAssetInfoWithProofs

func (*UpdateAssetInfoWithProofs) BinarySize added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) BinarySize() int

func (*UpdateAssetInfoWithProofs) BodyMarshalBinary added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) BodyMarshalBinary() ([]byte, error)

func (*UpdateAssetInfoWithProofs) GenerateID added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) GenerateID(scheme Scheme) error

func (UpdateAssetInfoWithProofs) GetFee added in v0.5.0

func (tx UpdateAssetInfoWithProofs) GetFee() uint64

func (UpdateAssetInfoWithProofs) GetID added in v0.5.0

func (tx UpdateAssetInfoWithProofs) GetID(scheme Scheme) ([]byte, error)

func (UpdateAssetInfoWithProofs) GetSenderPK added in v0.5.0

func (tx UpdateAssetInfoWithProofs) GetSenderPK() crypto.PublicKey

func (UpdateAssetInfoWithProofs) GetTimestamp added in v0.5.0

func (tx UpdateAssetInfoWithProofs) GetTimestamp() uint64

func (UpdateAssetInfoWithProofs) GetTypeInfo added in v0.5.0

func (UpdateAssetInfoWithProofs) GetVersion added in v0.5.0

func (tx UpdateAssetInfoWithProofs) GetVersion() byte

func (*UpdateAssetInfoWithProofs) MarshalBinary added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) MarshalBinary() ([]byte, error)

func (*UpdateAssetInfoWithProofs) MarshalSignedToProtobuf added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) MarshalSignedToProtobuf(scheme Scheme) ([]byte, error)

func (*UpdateAssetInfoWithProofs) MarshalToProtobuf added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) MarshalToProtobuf(scheme Scheme) ([]byte, error)

func (*UpdateAssetInfoWithProofs) Sign added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) Sign(scheme Scheme, secretKey crypto.SecretKey) error

func (*UpdateAssetInfoWithProofs) ToProtobuf added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) ToProtobuf(scheme Scheme) (*g.Transaction, error)

func (*UpdateAssetInfoWithProofs) ToProtobufSigned added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) ToProtobufSigned(scheme Scheme) (*g.SignedTransaction, error)

func (*UpdateAssetInfoWithProofs) UnmarshalBinary added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) UnmarshalBinary(data []byte, scheme Scheme) error

func (*UpdateAssetInfoWithProofs) UnmarshalFromProtobuf added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) UnmarshalFromProtobuf(data []byte) error

func (*UpdateAssetInfoWithProofs) UnmarshalSignedFromProtobuf added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) UnmarshalSignedFromProtobuf(data []byte) error

func (*UpdateAssetInfoWithProofs) Validate added in v0.8.0

func (tx *UpdateAssetInfoWithProofs) Validate() (Transaction, error)

func (*UpdateAssetInfoWithProofs) Verify added in v0.5.0

func (tx *UpdateAssetInfoWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, error)

type Version

type Version struct {
	Major, Minor, Patch uint32
}

Version represents the version of the protocol

func NewVersion added in v0.6.0

func NewVersion(Major, Minor, Patch uint32) Version

func NewVersionFromString added in v0.3.0

func NewVersionFromString(version string) (*Version, error)

func (Version) Cmp added in v0.6.0

func (a Version) Cmp(other Version) int

func (Version) CmpMinor added in v0.8.1

func (a Version) CmpMinor(other Version) int

Compare minor version. If equal return 0. If diff only 1 version (for example 1.14 and 1.13), then 1 If more then 1 version, then return 2.

func (*Version) MarshalJSON added in v0.3.0

func (a *Version) MarshalJSON() ([]byte, error)

func (*Version) ReadFrom added in v0.3.0

func (a *Version) ReadFrom(r io.Reader) (int64, error)

func (Version) String added in v0.3.0

func (a Version) String() string

func (Version) WriteTo added in v0.3.0

func (a Version) WriteTo(writer io.Writer) (int64, error)

type WrapWriteTo added in v0.3.0

type WrapWriteTo struct {
	// contains filtered or unexported fields
}

func (WrapWriteTo) Read added in v0.3.0

func (a WrapWriteTo) Read(b []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL