proto

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 42 Imported by: 38

Documentation

Index

Constants

View Source
const (
	AddressIDSize = 20

	WavesAddressSize = wavesAddressHeaderSize + wavesAddressBodySize + wavesAddressChecksumSize

	AliasMinLength = 4
	AliasMaxLength = 30
	AliasAlphabet  = "-.0123456789@_abcdefghijklmnopqrstuvwxyz"
	AliasPrefix    = "alias"

	EthereumAddressSize = AddressIDSize

	MainNetScheme   byte = 'W'
	TestNetScheme   byte = 'T'
	StageNetScheme  byte = 'S'
	CustomNetScheme byte = 'E'
)
View Source
const (
	AssetIDSize     = 20
	AssetIDTailSize = crypto.DigestSize - AssetIDSize
)
View Source
const (
	MicroBlockInvSizeSig  = crypto.PublicKeySize + crypto.SignatureSize*3
	MicroBlockInvSizeHash = crypto.PublicKeySize + crypto.DigestSize*2 + crypto.SignatureSize
)
View Source
const (
	DataScriptActionGroupType = iota + 1
	AttachedPaymentScriptActionGroupType
	AssetScriptActionGroupType
	BalanceScriptActionGroupType
)
View Source
const (
	MaxDescriptionLen = 1000
	MaxAssetNameLen   = 16
	MinAssetNameLen   = 4
	MaxDecimals       = 8

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

	MinFee              = 100_000
	MinFeeScriptedAsset = 400_000
	MinFeeInvokeScript  = 500_000

	MaxContractScriptSizeV1V5 = 32 * KiB
	MaxContractScriptSizeV6   = 160 * KiB
	MaxVerifierScriptSize     = 8 * KiB
	KiB                       = 1024
	MiB                       = 1024 * KiB
)
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)
	MaxKeySize                      = 100
	MaxPBKeySize                    = 400
	MaxDataWithProofsBytes          = 150 * 1024
	MaxDataWithProofsProtoBytes     = 165_890
	MaxDataWithProofsV6PayloadBytes = 165_835 // (DataEntry.MaxPBKeySize + DataEntry.MaxValueSize) * 5

	MaxDataEntriesScriptActionsSizeInBytesV1 = 5 * 1024
	MaxDataEntriesScriptActionsSizeInBytesV2 = 15 * 1024
	MaxScriptActionsV1                       = 10
	MaxScriptActionsV2                       = 30
	MaxDataEntryScriptActions                = 100
	MaxBalanceScriptActionsV3                = 100
	MaxAttachedPaymentsScriptActions         = 100
	MaxAssetScriptActionsV3                  = 30
)
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 DiffEthWaves = waveletToWeiMultiplier // in ethereum numbers are represented in 10^18. In waves it's 10^8
View Source
const EthereumGasPrice = 10 * ethereumGWei

EthereumGasPrice is a constant GasPrice which equals 10GWei according to the specification

View Source
const (
	// EthereumHashSize is the expected length of the hash in bytes
	EthereumHashSize = 32
)
View Source
const (
	EthereumPublicKeyLength = 64
)
View Source
const (
	HeaderContentIDPosition = 8
)
View Source
const IpPortLength = net.IPv6len + 8

Variables

View Source
var (
	ErrInvalidSig         = errors.New("invalid transaction v, r, s values")
	ErrTxTypeNotSupported = errors.New("transaction type not supported")
)
View Source
var ErrInvalidChainId = errors.New("invalid chain id for signer")
View Source
var ErrNotFound = errors.New("not found")
View Source
var (

	// ProtobufTransactionsVersions map shows whether transaction can be marshaled as protobuf data or not.
	// Value of ProtobufTransactionsVersions is minimum required transaction version to protobuf marshaling.
	ProtobufTransactionsVersions = map[TransactionType]byte{
		GenesisTransaction:          2,
		PaymentTransaction:          2,
		TransferTransaction:         3,
		IssueTransaction:            3,
		ReissueTransaction:          3,
		BurnTransaction:             3,
		ExchangeTransaction:         3,
		LeaseTransaction:            3,
		LeaseCancelTransaction:      3,
		CreateAliasTransaction:      3,
		MassTransferTransaction:     2,
		DataTransaction:             2,
		SetScriptTransaction:        2,
		SponsorshipTransaction:      2,
		SetAssetScriptTransaction:   2,
		InvokeScriptTransaction:     2,
		InvokeExpressionTransaction: 1,
		UpdateAssetInfoTransaction:  1,
		EthereumMetamaskTransaction: 1,
	}
)
View Source
var ProtocolVersion = NewVersion(1, 4, 0)

Functions

func AppendHeaderBytesToTransactions added in v0.3.0

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

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 DecodeFromHexString added in v0.10.0

func DecodeFromHexString(s string) ([]byte, error)

DecodeFromHexString decodes bytes from a hex string which can start with 0x prefix.

func DigestTail added in v0.10.0

func DigestTail(digest crypto.Digest) [AssetIDTailSize]byte

func EncodeToHexString added in v0.10.0

func EncodeToHexString(b []byte) string

EncodeToHexString encodes b as a hex string with 0x prefix.

func EthereumWeiToWavelet added in v0.10.0

func EthereumWeiToWavelet(weiAmount *big.Int) (int64, error)

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 GenerateLeaseScriptActionID added in v0.9.0

func GenerateLeaseScriptActionID(recipient Recipient, amount int64, nonce int64, txID crypto.Digest) crypto.Digest

GenerateLeaseScriptActionID implements ID generation used in RIDE to create new ID for a Lease action.

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) (data []byte, err 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 NewScriptResult added in v0.5.0

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

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

func NewTimestampFromTime added in v0.3.0

func NewTimestampFromTime(t time.Time) 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) error

PutBytesWithUInt16Len prepends given buf with 2 bytes of its length.

func PutBytesWithUInt32Len added in v0.3.0

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

PutBytesWithUInt32Len prepends given buf with 4 bytes of its 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 ReconstructDigest added in v0.10.0

func ReconstructDigest(id AssetID, tail [AssetIDTailSize]byte) crypto.Digest

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 than 1 byte or the length of remaining slice is less than the length value from first byte.

func TransactionToProtobufCommon added in v0.5.0

func TransactionToProtobufCommon(scheme Scheme, senderPublicKey []byte, tx Transaction) *g.Transaction

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

func UnmarshalTransactionFromJSON added in v0.10.4

func UnmarshalTransactionFromJSON(data []byte, scheme Scheme, tx Transaction) (err error)

func ValidateActions added in v0.5.0

func ValidateActions(
	actions []ScriptAction,
	restrictions ActionsValidationRestrictions,
	isRideV6Activated bool,
	libVersion ast.LibraryVersion,
	validatePayments bool,
) error

func ValidateAttachedPaymentScriptAction added in v0.10.0

func ValidateAttachedPaymentScriptAction(action *AttachedPaymentScriptAction, restrictions ActionsValidationRestrictions, validatePayments bool) error

func ValidateBurnScriptAction added in v0.10.0

func ValidateBurnScriptAction(action *BurnScriptAction) error

func ValidateDataEntryScriptAction added in v0.10.0

func ValidateDataEntryScriptAction(action *DataEntryScriptAction, restrictions ActionsValidationRestrictions, isRideV6Activated bool, dataEntriesSize int) (int, error)

func ValidateEthereumSignatureValues added in v0.10.0

func ValidateEthereumSignatureValues(v byte, r, s *big.Int) bool

ValidateEthereumSignatureValues verifies whether the signature values are valid with the given chain rules. The v value is assumed to be either 0 or 1.

func ValidateIssueScriptAction added in v0.10.0

func ValidateIssueScriptAction(action *IssueScriptAction) error

func ValidateLeaseScriptAction added in v0.10.0

func ValidateLeaseScriptAction(action *LeaseScriptAction, 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 ValidateReissueScriptAction added in v0.10.0

func ValidateReissueScriptAction(action *ReissueScriptAction) error

func ValidateSponsorshipScriptAction added in v0.10.0

func ValidateSponsorshipScriptAction(action *SponsorshipScriptAction) error

func ValidateTransferScriptAction added in v0.10.0

func ValidateTransferScriptAction(action *TransferScriptAction, restrictions ActionsValidationRestrictions) error

func VerifyEthereumSignature added in v0.10.0

func VerifyEthereumSignature(pubKey *EthereumPublicKey, rBig, sBig *big.Int, hash []byte) bool

VerifyEthereumSignature checks that the given public key created signature over hash. The public key should be in compressed (33 bytes) or uncompressed (65 bytes) format.

func VersionFromScriptBytes added in v0.5.0

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

func WaveletToEthereumWei added in v0.10.0

func WaveletToEthereumWei(waveletAmount uint64) *big.Int

Types

type ActionsCountValidator added in v0.10.0

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

func NewScriptActionsCountValidator added in v0.10.0

func NewScriptActionsCountValidator() ActionsCountValidator

func (*ActionsCountValidator) CountAction added in v0.10.0

func (v *ActionsCountValidator) CountAction(action ScriptAction, libVersion ast.LibraryVersion, isRideV6Activated bool) error

func (*ActionsCountValidator) ValidateCounts added in v0.10.0

func (v *ActionsCountValidator) ValidateCounts(libVersion ast.LibraryVersion, isRideV6Activated bool) error

type ActionsValidationRestrictions added in v0.5.0

type ActionsValidationRestrictions struct {
	DisableSelfTransfers  bool
	ScriptAddress         WavesAddress
	IsUTF16KeyLen         bool
	IsProtobufTransaction bool
	MaxDataEntriesSize    int
	Scheme                byte
}

type Address

type Address interface {
	ID() AddressID
	Bytes() []byte
	String() string
	Equal(address Address) bool
	ToWavesAddress(scheme Scheme) (WavesAddress, error)
}

type AddressID added in v0.10.0

type AddressID [AddressIDSize]byte

func (AddressID) Bytes added in v0.10.0

func (a AddressID) Bytes() []byte

func (AddressID) Equal added in v0.10.5

func (a AddressID) Equal(id AddressID) bool

func (AddressID) ToWavesAddress added in v0.10.0

func (a AddressID) ToWavesAddress(scheme Scheme) (WavesAddress, error)

type Alias

type Alias struct {
	Version byte
	Scheme  byte
	Alias   string
}

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

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

UnmarshalBinary 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(scheme Scheme) (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"`
}

ArgumentType 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

ArgumentValueType 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 ConvertDecodedEthereumArgumentsToProtoArguments added in v0.10.5

func ConvertDecodedEthereumArgumentsToProtoArguments(decodedArgs []ethabi.DecodedArg) (Arguments, error)

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 AssetID added in v0.10.0

type AssetID [AssetIDSize]byte

func AssetIDFromDigest added in v0.10.0

func AssetIDFromDigest(digest crypto.Digest) AssetID

func (AssetID) Bytes added in v0.10.0

func (a AssetID) Bytes() []byte

func (AssetID) Digest added in v0.10.0

func (a AssetID) Digest(tail [AssetIDTailSize]byte) crypto.Digest

func (AssetID) String added in v0.10.0

func (a AssetID) String() string

type AssetInfo added in v0.3.0

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

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 AttachedPaymentScriptAction added in v0.10.0

type AttachedPaymentScriptAction struct {
	Sender    *crypto.PublicKey
	Recipient Recipient
	Amount    int64
	Asset     OptionalAsset
}

func (*AttachedPaymentScriptAction) GroupType added in v0.10.0

func (*AttachedPaymentScriptAction) SenderPK added in v0.10.0

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 B64Bytes added in v0.10.0

type B64Bytes []byte

func (B64Bytes) Bytes added in v0.10.0

func (b B64Bytes) Bytes() []byte

func (B64Bytes) MarshalJSON added in v0.10.0

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

func (B64Bytes) String added in v0.10.0

func (b B64Bytes) String() string

func (*B64Bytes) UnmarshalJSON added in v0.10.0

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

type BinaryArgument added in v0.3.0

type BinaryArgument struct {
	Value []byte
}

BinaryArgument represents an argument that stores binary value.

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) PayloadSize added in v0.10.0

func (e BinaryDataEntry) PayloadSize() int

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(forbidEmptyKey, utf16KeyLen bool) 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(scheme Scheme) ([]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, scheme Scheme) (int64, error)

func (*Block) WriteToWithoutSignature added in v0.3.0

func (b *Block) WriteToWithoutSignature(w io.Writer, scheme Scheme) (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"`
	GeneratorPublicKey     crypto.PublicKey `json:"generatorPublicKey"`
	BlockSignature         crypto.Signature `json:"signature"`
	TransactionsRoot       B58Bytes         `json:"transactionsRoot,omitempty"`

	ID BlockID `json:"id"` // this field must be generated and set after Block unmarshalling
}

BlockHeader contains Block meta-information without 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 {
	Version             BlockVersion
	Timestamp           uint64
	Height              uint64
	BaseTarget          uint64
	Generator           WavesAddress
	GeneratorPublicKey  crypto.PublicKey
	GenerationSignature B58Bytes
	VRF                 B58Bytes
	Rewards             Rewards
}

func BlockInfoFromHeader added in v0.3.0

func BlockInfoFromHeader(header *BlockHeader, generator WavesAddress, height uint64, vrf []byte, rewards Rewards) (*BlockInfo, error)

func NewBlockInfo added in v0.10.6

func NewBlockInfo(version BlockVersion, timestamp, height, baseTarget uint64,
	generatorAddress WavesAddress, generatorPK crypto.PublicKey,
	generationSignature, vrf []byte, rewards Rewards) *BlockInfo

func (*BlockInfo) CopyGenerationSignature added in v0.10.6

func (bi *BlockInfo) CopyGenerationSignature() []byte

func (*BlockInfo) CopyGeneratorPublicKey added in v0.10.6

func (bi *BlockInfo) CopyGeneratorPublicKey() []byte

func (*BlockInfo) CopyVRF added in v0.10.6

func (bi *BlockInfo) CopyVRF() []byte

func (*BlockInfo) IsEmptyGenerator added in v0.10.6

func (bi *BlockInfo) IsEmptyGenerator() bool

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 (*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) PayloadSize added in v0.10.0

func (e BooleanDataEntry) PayloadSize() int

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(forbidEmptyKey, utf16KeyLen bool) error

type BulkMessage added in v0.3.0

type BulkMessage []Message

func (BulkMessage) MarshalBinary added in v0.3.0

func (a BulkMessage) MarshalBinary() (data []byte, err error)

func (BulkMessage) ReadFrom added in v0.3.0

func (BulkMessage) ReadFrom(_ 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) GetSender added in v0.10.0

func (b Burn) GetSender(scheme Scheme) (Address, error)

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 {
	Sender   *crypto.PublicKey
	AssetID  crypto.Digest // assetId
	Quantity int64         // quantity
}

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

func (*BurnScriptAction) GroupType added in v0.10.0

func (a *BurnScriptAction) GroupType() ScriptActionGroupType

func (*BurnScriptAction) SenderPK added in v0.9.0

func (a *BurnScriptAction) SenderPK() *crypto.PublicKey

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"`
	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 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(scheme Scheme) ([]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(scheme Scheme) ([]byte, error)

MarshalBinary writes BurnWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *BurnWithProofs) MerkleBytes(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 byte 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(_ Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *BurnWithSig) MerkleBytes(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(_ Scheme) (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 ByteVector added in v0.10.2

type ByteVector []byte

func (ByteVector) Bytes added in v0.10.2

func (v ByteVector) Bytes() []byte

func (ByteVector) MarshalJSON added in v0.10.2

func (v ByteVector) MarshalJSON() ([]byte, error)

MarshalJSON writes ByteVector Value as JSON string

func (ByteVector) String added in v0.10.2

func (v ByteVector) String() string

String represents underlying bytes as Base58 string or Base64 string with additional prefix.

func (*ByteVector) UnmarshalJSON added in v0.10.2

func (v *ByteVector) UnmarshalJSON(value []byte) error

UnmarshalJSON reads ByteVector from JSON string

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) GetSender added in v0.10.0

func (ca CreateAlias) GetSender(scheme Scheme) (Address, error)

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(scheme Scheme) (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(Scheme) ([]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(scheme Scheme) ([]byte, error)

MarshalBinary saves the transaction to its binary representation.

func (*CreateAliasWithProofs) MarshalJSON added in v0.10.3

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

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) MerkleBytes added in v0.10.0

func (tx *CreateAliasWithProofs) MerkleBytes(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 deprecated added in v0.5.0

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

Deprecated: use UnmarshalJSONWithScheme.

func (*CreateAliasWithProofs) UnmarshalJSONWithScheme added in v0.10.4

func (tx *CreateAliasWithProofs) UnmarshalJSONWithScheme(data []byte, scheme Scheme) 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(scheme Scheme) (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(Scheme) ([]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(scheme Scheme) ([]byte, error)

func (*CreateAliasWithSig) MarshalJSON added in v0.10.3

func (tx *CreateAliasWithSig) MarshalJSON() ([]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) MerkleBytes added in v0.10.0

func (tx *CreateAliasWithSig) MerkleBytes(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 deprecated added in v0.5.0

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

Deprecated: use UnmarshalJSONWithScheme.

func (*CreateAliasWithSig) UnmarshalJSONWithScheme added in v0.10.4

func (tx *CreateAliasWithSig) UnmarshalJSONWithScheme(data []byte, scheme Scheme) 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(scheme Scheme) (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) BinarySize added in v0.10.0

func (e DataEntries) BinarySize() int

BinarySize returns summary binary size of all entries.

func (DataEntries) PayloadSize added in v0.10.0

func (e DataEntries) PayloadSize() int

PayloadSize returns summary payload size of all entries.

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.

func (DataEntries) Valid added in v0.10.0

func (e DataEntries) Valid(forbidEmptyKey, utf16KeyLen bool) error

Valid calls DataEntry.Valid for 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(forbidEmptyKey, utf16KeyLen bool) error
	BinarySize() int
	PayloadSize() 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 NewDataEntryFromJSON added in v0.10.0

func NewDataEntryFromJSON(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 {
	Sender *crypto.PublicKey
	Entry  DataEntry
}

DataEntryScriptAction is an action to manipulate account data state.

func (*DataEntryScriptAction) GroupType added in v0.10.0

func (*DataEntryScriptAction) SenderPK added in v0.9.0

func (a *DataEntryScriptAction) SenderPK() *crypto.PublicKey

func (*DataEntryScriptAction) ToProtobuf added in v0.5.0

type DataValueType added in v0.3.0

type DataValueType byte

DataValueType 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 NewUnsignedDataWithProofs added in v0.10.0

func NewUnsignedDataWithProofs(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(Scheme) ([]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) GetSender added in v0.10.0

func (tx DataWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

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

func (*DataWithProofs) ProtoPayload added in v0.8.8

func (tx *DataWithProofs) ProtoPayload() *g.DataTransactionData

func (*DataWithProofs) ProtoPayloadSize added in v0.10.0

func (tx *DataWithProofs) ProtoPayloadSize() int

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(_ Scheme) (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) PayloadSize added in v0.10.0

func (e DeleteDataEntry) PayloadSize() int

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(forbidEmptyKey, utf16KeyLen bool) error

type DigestWrapped added in v0.6.0

type DigestWrapped crypto.Digest

DigestWrapped 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 EnrichedFullAssetInfo added in v0.10.5

type EnrichedFullAssetInfo struct {
	FullAssetInfo
	SequenceInBlock uint32
}

type EthereumAccessList added in v0.10.0

type EthereumAccessList []EthereumAccessTuple

EthereumAccessList is an EIP-2930 access list.

type EthereumAccessListTx added in v0.10.0

type EthereumAccessListTx struct {
	ChainID    *big.Int           // destination chain ID
	Nonce      uint64             // nonce of sender account
	GasPrice   *big.Int           // wei per gas
	Gas        uint64             // gas limit
	To         *EthereumAddress   // nil value means contract creation
	Value      *big.Int           // wei amount
	Data       []byte             // contract invocation input data
	AccessList EthereumAccessList // EIP-2930 access list
	V, R, S    *big.Int           // signature values
}

EthereumAccessListTx is the data of EIP-2930 access list transactions.

func (*EthereumAccessListTx) DecodeRLP added in v0.10.0

func (tx *EthereumAccessListTx) DecodeRLP(rlpData []byte) error

func (*EthereumAccessListTx) EncodeRLP added in v0.10.0

func (tx *EthereumAccessListTx) EncodeRLP(w io.Writer) error

type EthereumAccessTuple added in v0.10.0

type EthereumAccessTuple struct {
	Address     EthereumAddress `json:"address"`
	StorageKeys []EthereumHash  `json:"storageKeys"`
}

EthereumAccessTuple is the element type of an access list.

type EthereumAddress added in v0.10.0

type EthereumAddress [EthereumAddressSize]byte

EthereumAddress is the first 20 bytes of Public Key's hash for the Waves address, or the 20 bytes of an Ethereum address.

func BytesToEthereumAddress added in v0.10.0

func BytesToEthereumAddress(b []byte) EthereumAddress

BytesToEthereumAddress returns EthereumAddress with value b. If b is larger than len(h), b will be cropped from the left.

func ExtractEthereumSender added in v0.10.0

func ExtractEthereumSender(signer EthereumSigner, tx *EthereumTransaction) (EthereumAddress, error)

func NewEthereumAddressFromBytes added in v0.10.0

func NewEthereumAddressFromBytes(b []byte) (EthereumAddress, error)

func NewEthereumAddressFromHexString added in v0.10.0

func NewEthereumAddressFromHexString(s string) (EthereumAddress, error)

func (EthereumAddress) Bytes added in v0.10.0

func (ea EthereumAddress) Bytes() []byte

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

func (EthereumAddress) Equal added in v0.10.0

func (ea EthereumAddress) Equal(address Address) bool

func (EthereumAddress) Hash added in v0.10.0

func (ea EthereumAddress) Hash() EthereumHash

Hash converts an address to a EthereumHash by left-padding it with zeros.

func (EthereumAddress) Hex added in v0.10.0

func (ea EthereumAddress) Hex() string

func (EthereumAddress) ID added in v0.10.0

func (ea EthereumAddress) ID() AddressID

func (EthereumAddress) MarshalJSON added in v0.10.0

func (ea EthereumAddress) MarshalJSON() ([]byte, error)

func (EthereumAddress) String added in v0.10.0

func (ea EthereumAddress) String() string

func (EthereumAddress) ToWavesAddress added in v0.10.0

func (ea EthereumAddress) ToWavesAddress(scheme Scheme) (WavesAddress, error)

func (*EthereumAddress) UnmarshalJSON added in v0.10.0

func (ea *EthereumAddress) UnmarshalJSON(bytes []byte) error

type EthereumDynamicFeeTx added in v0.10.0

type EthereumDynamicFeeTx struct {
	ChainID    *big.Int           // destination chain ID
	Nonce      uint64             // nonce of sender account
	GasTipCap  *big.Int           // EIP-1559 value
	GasFeeCap  *big.Int           // EIP-1559 value
	Gas        uint64             // gas limit
	To         *EthereumAddress   // nil means contract creation
	Value      *big.Int           // wei amount
	Data       []byte             // contract invocation input data
	AccessList EthereumAccessList // EIP-2930 access list
	V, R, S    *big.Int           // signature values
}

func (*EthereumDynamicFeeTx) DecodeRLP added in v0.10.0

func (tx *EthereumDynamicFeeTx) DecodeRLP(rlpData []byte) error

func (*EthereumDynamicFeeTx) EncodeRLP added in v0.10.0

func (tx *EthereumDynamicFeeTx) EncodeRLP(w io.Writer) error

type EthereumHash added in v0.10.0

type EthereumHash [EthereumHashSize]byte

EthereumHash represents the 32 byte Keccak256 hash of arbitrary data.

func BytesToEthereumHash added in v0.10.0

func BytesToEthereumHash(b []byte) EthereumHash

BytesToEthereumHash sets b to hash. If b is larger than len(h), b will be cropped from the left.

func Keccak256EthereumHash added in v0.10.0

func Keccak256EthereumHash(data []byte) EthereumHash

Keccak256EthereumHash calculates and returns the Keccak256 hash of the input data, converting it to an EthereumHash data structure.

func (EthereumHash) Bytes added in v0.10.0

func (h EthereumHash) Bytes() []byte

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

func (EthereumHash) Hex added in v0.10.0

func (h EthereumHash) Hex() string

Hex converts a hash to a hex string.

func (EthereumHash) MarshalJSON added in v0.10.0

func (h EthereumHash) MarshalJSON() ([]byte, error)

func (*EthereumHash) SetBytes added in v0.10.0

func (h *EthereumHash) SetBytes(b []byte)

SetBytes sets the hash to the value of b. If b is larger than len(h), b will be cropped from the left.

func (EthereumHash) String added in v0.10.0

func (h EthereumHash) String() string

String implements the stringer interface and is used also by the logger when doing full logging into a file.

func (*EthereumHash) UnmarshalJSON added in v0.10.0

func (h *EthereumHash) UnmarshalJSON(bytes []byte) error

type EthereumInvokeScriptTxKind added in v0.10.0

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

func NewEthereumInvokeScriptTxKind added in v0.10.0

func NewEthereumInvokeScriptTxKind(decodedData ethabi.DecodedCallData) *EthereumInvokeScriptTxKind

func (*EthereumInvokeScriptTxKind) DecodedData added in v0.10.0

func (*EthereumInvokeScriptTxKind) String added in v0.10.0

func (k *EthereumInvokeScriptTxKind) String() string

func (*EthereumInvokeScriptTxKind) ValidateCallData added in v0.10.5

func (k *EthereumInvokeScriptTxKind) ValidateCallData(dApp WavesAddress) error

type EthereumLegacyTx added in v0.10.0

type EthereumLegacyTx struct {
	Nonce    uint64           // nonce of sender account
	GasPrice *big.Int         // wei per gas
	Gas      uint64           // gas limit
	To       *EthereumAddress // nil value means contract creation
	Value    *big.Int         // wei amount
	Data     []byte           // contract invocation input data
	V, R, S  *big.Int         // signature values
}

EthereumLegacyTx is the transaction data of regular Ethereum transactions.

func (*EthereumLegacyTx) DecodeRLP added in v0.10.0

func (tx *EthereumLegacyTx) DecodeRLP(rlpData []byte) error

func (*EthereumLegacyTx) EncodeRLP added in v0.10.0

func (tx *EthereumLegacyTx) EncodeRLP(w io.Writer) error

type EthereumOrderV4 added in v0.10.0

type EthereumOrderV4 struct {
	SenderPK        ethereumPublicKeyBase58Wrapper `json:"senderPublicKey"`
	Eip712Signature EthereumSignature              `json:"eip712Signature,omitempty"`
	OrderV4
}

func NewUnsignedEthereumOrderV4 added in v0.10.0

func NewUnsignedEthereumOrderV4(senderPK *EthereumPublicKey, matcherPK crypto.PublicKey, amountAsset, priceAsset OptionalAsset, orderType OrderType, price, amount, timestamp, expiration, matcherFee uint64, matcherFeeAsset OptionalAsset, priceMode OrderPriceMode) *EthereumOrderV4

NewUnsignedEthereumOrderV4 creates the new ethereum unsigned order.

func (*EthereumOrderV4) BodyMarshalBinary added in v0.10.0

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

func (*EthereumOrderV4) EthereumSign added in v0.10.0

func (o *EthereumOrderV4) EthereumSign(scheme Scheme, sk *EthereumPrivateKey) (err error)

EthereumSign signs order and sets senderPK with provided *EthereumPrivateKey. This method is used only for test purposes

func (*EthereumOrderV4) GenerateID added in v0.10.0

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

func (*EthereumOrderV4) GenerateSenderPK added in v0.10.0

func (o *EthereumOrderV4) GenerateSenderPK(scheme Scheme) error

func (*EthereumOrderV4) GetSender added in v0.10.0

func (o *EthereumOrderV4) GetSender(_ Scheme) (Address, error)

func (*EthereumOrderV4) GetSenderPKBytes added in v0.10.0

func (o *EthereumOrderV4) GetSenderPKBytes() []byte

func (*EthereumOrderV4) Sign added in v0.10.0

func (*EthereumOrderV4) ToProtobuf added in v0.10.0

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

func (*EthereumOrderV4) ToProtobufSigned added in v0.10.0

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

func (*EthereumOrderV4) Valid added in v0.10.0

func (o *EthereumOrderV4) Valid() (bool, error)

func (*EthereumOrderV4) Verify added in v0.10.0

func (o *EthereumOrderV4) Verify(scheme Scheme) (bool, error)

type EthereumPrivateKey added in v0.10.0

type EthereumPrivateKey btcec.PrivateKey

EthereumPrivateKey is an Ethereum ecdsa.PrivateKey.

func (*EthereumPrivateKey) EthereumPublicKey added in v0.10.0

func (esk *EthereumPrivateKey) EthereumPublicKey() *EthereumPublicKey

EthereumPublicKey returns *EthereumPublicKey from corresponding EthereumPrivateKey.

type EthereumPublicKey added in v0.10.0

type EthereumPublicKey btcec.PublicKey

EthereumPublicKey is an Ethereum ecdsa.PublicKey.

func NewEthereumPublicKeyFromBase58String added in v0.10.0

func NewEthereumPublicKeyFromBase58String(s string) (EthereumPublicKey, error)

NewEthereumPublicKeyFromBase58String creates an EthereumPublicKey from its string representation.

func NewEthereumPublicKeyFromBytes added in v0.10.0

func NewEthereumPublicKeyFromBytes(b []byte) (EthereumPublicKey, error)

func NewEthereumPublicKeyFromHexString added in v0.10.0

func NewEthereumPublicKeyFromHexString(s string) (EthereumPublicKey, error)

func (*EthereumPublicKey) EthereumAddress added in v0.10.0

func (epk *EthereumPublicKey) EthereumAddress() EthereumAddress

func (*EthereumPublicKey) MarshalBinary added in v0.10.0

func (epk *EthereumPublicKey) MarshalBinary() (data []byte, err error)

func (*EthereumPublicKey) MarshalJSON added in v0.10.0

func (epk *EthereumPublicKey) MarshalJSON() ([]byte, error)

MarshalJSON marshal EthereumPublicKey in hex encoding.

func (*EthereumPublicKey) SerializeCompressed added in v0.10.0

func (epk *EthereumPublicKey) SerializeCompressed() []byte

SerializeCompressed serializes a public key in a 33-byte compressed format.

func (*EthereumPublicKey) SerializeUncompressed added in v0.10.0

func (epk *EthereumPublicKey) SerializeUncompressed() []byte

SerializeUncompressed serializes a public key in a 65-byte uncompressed format.

func (*EthereumPublicKey) SerializeXYCoordinates added in v0.10.0

func (epk *EthereumPublicKey) SerializeXYCoordinates() []byte

SerializeXYCoordinates serializes a public key in a 64-byte uncompressed format without 0x4 byte prefix.

func (*EthereumPublicKey) String added in v0.10.0

func (epk *EthereumPublicKey) String() string

func (*EthereumPublicKey) ToECDSA added in v0.10.0

func (epk *EthereumPublicKey) ToECDSA() *ecdsa.PublicKey

ToECDSA returns the public key as a *ecdsa.PublicKey.

func (*EthereumPublicKey) UnmarshalBinary added in v0.10.0

func (epk *EthereumPublicKey) UnmarshalBinary(data []byte) error

func (*EthereumPublicKey) UnmarshalJSON added in v0.10.0

func (epk *EthereumPublicKey) UnmarshalJSON(bytes []byte) error

UnmarshalJSON unmarshal EthereumPublicKey from hex encoding.

type EthereumSignature added in v0.10.0

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

EthereumSignature represents ethereum signature (v, r, s signature values).

func NewEthereumSignatureFromBytes added in v0.10.0

func NewEthereumSignatureFromBytes(b []byte) (ethSig EthereumSignature, err error)

func NewEthereumSignatureFromHexString added in v0.10.0

func NewEthereumSignatureFromHexString(hexString string) (ethSig EthereumSignature, err error)

func NewEthereumSignatureFromVRS added in v0.10.3

func NewEthereumSignatureFromVRS(v byte, r, s *big.Int) (EthereumSignature, error)

func (*EthereumSignature) AsVRS added in v0.10.0

func (es *EthereumSignature) AsVRS() (v byte, r, s *big.Int)

AsVRS return ethereum signature as V, R, S signature values. Note that V can be 27/28 for legacy reasons, but real V value is 0/1.

func (*EthereumSignature) Bytes added in v0.10.0

func (es *EthereumSignature) Bytes() []byte

func (*EthereumSignature) MarshalBinary added in v0.10.0

func (es *EthereumSignature) MarshalBinary() (data []byte, err error)

func (*EthereumSignature) MarshalJSON added in v0.10.0

func (es *EthereumSignature) MarshalJSON() ([]byte, error)

func (*EthereumSignature) R added in v0.10.4

func (es *EthereumSignature) R() *big.Int

R returns r signature value.

func (*EthereumSignature) RecoverEthereumPublicKey added in v0.10.0

func (es *EthereumSignature) RecoverEthereumPublicKey(digest []byte) (*EthereumPublicKey, error)

func (*EthereumSignature) S added in v0.10.4

func (es *EthereumSignature) S() *big.Int

S returns s signature value.

func (*EthereumSignature) String added in v0.10.0

func (es *EthereumSignature) String() string

func (*EthereumSignature) UnmarshalBinary added in v0.10.0

func (es *EthereumSignature) UnmarshalBinary(data []byte) error

func (*EthereumSignature) UnmarshalJSON added in v0.10.0

func (es *EthereumSignature) UnmarshalJSON(bytes []byte) error

func (*EthereumSignature) V added in v0.10.4

func (es *EthereumSignature) V() byte

V returns v signature value. Note that V can be 27/28 for legacy reasons, but real V value is 0/1.

type EthereumSigner added in v0.10.0

type EthereumSigner interface {
	// Sender returns the sender address of the transaction.
	Sender(tx *EthereumTransaction) (EthereumAddress, error)

	// SenderPK returns the sender public key of the transaction.
	SenderPK(tx *EthereumTransaction) (*EthereumPublicKey, error)

	// SignatureValues returns the raw R, S, V values corresponding to the given signature.
	SignatureValues(tx *EthereumTransaction, sig []byte) (r, s, v *big.Int, err error)

	ChainID() *big.Int

	// Hash returns 'signature hash', i.e. the transaction hash that is signed by the
	// private key. This hash does not uniquely identify the transaction.
	Hash(tx *EthereumTransaction) EthereumHash

	// Equal returns true if the given signer is the same as the receiver.
	Equal(EthereumSigner) bool
}

func MakeEthereumSigner added in v0.10.0

func MakeEthereumSigner(chainID *big.Int) EthereumSigner

MakeEthereumSigner returns a EthereumSigner based on the given chain config and block number.

func NewLondonEthereumSigner added in v0.10.0

func NewLondonEthereumSigner(chainId *big.Int) EthereumSigner

NewLondonEthereumSigner returns a signer that accepts - EIP-1559 dynamic fee transactions - EIP-2930 access list transactions, - EIP-155 replay protected transactions, and - legacy Homestead transactions.

type EthereumTransaction added in v0.10.0

type EthereumTransaction struct {
	TxKind EthereumTransactionKind
	ID     *crypto.Digest
	// contains filtered or unexported fields
}

func NewEthereumTransaction added in v0.10.0

func NewEthereumTransaction(inner EthereumTxData, txKind EthereumTransactionKind, id *crypto.Digest, senderPK *EthereumPublicKey, innerBinarySize int) EthereumTransaction

NewEthereumTransaction is a utility function which should be used ONLY in tests

func (*EthereumTransaction) AccessList added in v0.10.0

func (tx *EthereumTransaction) AccessList() EthereumAccessList

AccessList returns the access list of the transaction.

func (*EthereumTransaction) BinarySize added in v0.10.0

func (tx *EthereumTransaction) BinarySize() int

func (*EthereumTransaction) BodyMarshalBinary added in v0.10.0

func (tx *EthereumTransaction) BodyMarshalBinary(Scheme) ([]byte, error)

func (*EthereumTransaction) ChainId added in v0.10.0

func (tx *EthereumTransaction) ChainId() *big.Int

ChainId returns the EIP155 chain ID of the transaction. The return value will always be non-nil. For legacy transactions which are not replay-protected, the return value is zero.

func (*EthereumTransaction) Data added in v0.10.0

func (tx *EthereumTransaction) Data() []byte

Data returns the input data of the transaction.

func (*EthereumTransaction) DecodeCanonical added in v0.10.0

func (tx *EthereumTransaction) DecodeCanonical(canonicalData []byte) error

DecodeCanonical decodes the canonical binary encoding of transactions. It supports legacy RLP transactions and EIP2718 typed transactions.

func (*EthereumTransaction) EncodeCanonical added in v0.10.0

func (tx *EthereumTransaction) EncodeCanonical() ([]byte, error)

EncodeCanonical returns the canonical binary encoding of a transaction. For legacy transactions, it returns the RLP encoding. For EIP-2718 typed transactions, it returns the type and payload.

func (*EthereumTransaction) EthereumTxType added in v0.10.0

func (tx *EthereumTransaction) EthereumTxType() EthereumTxType

EthereumTxType returns the transaction type.

func (*EthereumTransaction) From added in v0.10.0

From returns the sender address of the transaction. Returns error if transaction doesn't pass validation.

func (*EthereumTransaction) FromPK added in v0.10.0

func (tx *EthereumTransaction) FromPK() (*EthereumPublicKey, error)

FromPK returns the sender public key of the transaction. Returns error if transaction doesn't pass validation.

func (*EthereumTransaction) Gas added in v0.10.0

func (tx *EthereumTransaction) Gas() uint64

Gas returns the gas limit of the transaction.

func (*EthereumTransaction) GasFeeCap added in v0.10.0

func (tx *EthereumTransaction) GasFeeCap() *big.Int

GasFeeCap returns the fee cap per gas of the transaction.

func (*EthereumTransaction) GasPrice added in v0.10.0

func (tx *EthereumTransaction) GasPrice() *big.Int

GasPrice returns the gas price of the transaction.

func (*EthereumTransaction) GasTipCap added in v0.10.0

func (tx *EthereumTransaction) GasTipCap() *big.Int

GasTipCap returns the gasTipCap per gas of the transaction.

func (*EthereumTransaction) GenerateID added in v0.10.0

func (tx *EthereumTransaction) GenerateID(_ Scheme) error

func (*EthereumTransaction) GetFee added in v0.10.0

func (tx *EthereumTransaction) GetFee() uint64

func (*EthereumTransaction) GetID added in v0.10.0

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

func (*EthereumTransaction) GetSender added in v0.10.0

func (tx *EthereumTransaction) GetSender(_ Scheme) (Address, error)

func (*EthereumTransaction) GetTimestamp added in v0.10.0

func (tx *EthereumTransaction) GetTimestamp() uint64

func (*EthereumTransaction) GetTypeInfo added in v0.10.0

func (tx *EthereumTransaction) GetTypeInfo() TransactionTypeInfo

func (*EthereumTransaction) GetVersion added in v0.10.0

func (tx *EthereumTransaction) GetVersion() byte

func (*EthereumTransaction) MarshalBinary added in v0.10.0

func (tx *EthereumTransaction) MarshalBinary(Scheme) ([]byte, error)

func (*EthereumTransaction) MarshalSignedToProtobuf added in v0.10.0

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

func (*EthereumTransaction) MarshalToProtobuf added in v0.10.0

func (tx *EthereumTransaction) MarshalToProtobuf(_ Scheme) ([]byte, error)

func (*EthereumTransaction) MerkleBytes added in v0.10.0

func (tx *EthereumTransaction) MerkleBytes(_ Scheme) ([]byte, error)

func (*EthereumTransaction) Nonce added in v0.10.0

func (tx *EthereumTransaction) Nonce() uint64

Nonce returns the sender account nonce of the transaction.

func (*EthereumTransaction) Protected added in v0.10.0

func (tx *EthereumTransaction) Protected() bool

Protected says whether the transaction is replay-protected.

func (*EthereumTransaction) RawSignatureValues added in v0.10.0

func (tx *EthereumTransaction) RawSignatureValues() (v, r, s *big.Int)

RawSignatureValues returns the V, R, S signature values of the transaction. The return values should not be modified by the caller.

func (*EthereumTransaction) Sign added in v0.10.0

func (*EthereumTransaction) To added in v0.10.0

To returns the recipient address of the transaction. For contract-creation transactions, To returns nil.

func (*EthereumTransaction) ToProtobuf added in v0.10.0

func (tx *EthereumTransaction) ToProtobuf(_ Scheme) (*g.Transaction, error)

func (*EthereumTransaction) ToProtobufSigned added in v0.10.0

func (tx *EthereumTransaction) ToProtobufSigned(_ Scheme) (*g.SignedTransaction, error)

func (*EthereumTransaction) UnmarshalBinary added in v0.10.0

func (tx *EthereumTransaction) UnmarshalBinary(_ []byte, _ Scheme) error

func (*EthereumTransaction) UnmarshalFromProtobuf added in v0.10.0

func (tx *EthereumTransaction) UnmarshalFromProtobuf(_ []byte) error

func (*EthereumTransaction) UnmarshalJSON added in v0.10.0

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

func (*EthereumTransaction) UnmarshalSignedFromProtobuf added in v0.10.0

func (tx *EthereumTransaction) UnmarshalSignedFromProtobuf(bytes []byte) error

func (*EthereumTransaction) Validate added in v0.10.0

func (tx *EthereumTransaction) Validate(scheme Scheme) (Transaction, error)

Validate performs basic checks for EthereumTransaction according to the specification This method doesn't include signature verification. Use Verify method for signature verification

func (*EthereumTransaction) Value added in v0.10.0

func (tx *EthereumTransaction) Value() *big.Int

Value returns the ether amount of the transaction.

func (*EthereumTransaction) Verify added in v0.10.0

func (tx *EthereumTransaction) Verify() (*EthereumPublicKey, error)

Verify performs ONLY transaction signature verification and calculates EthereumPublicKey of transaction For basic transaction checks use Validate method

func (*EthereumTransaction) WavesAddressFrom added in v0.10.0

func (tx *EthereumTransaction) WavesAddressFrom(scheme byte) (WavesAddress, error)

func (*EthereumTransaction) WavesAddressTo added in v0.10.0

func (tx *EthereumTransaction) WavesAddressTo(scheme byte) (WavesAddress, error)

type EthereumTransactionKind added in v0.10.0

type EthereumTransactionKind interface {
	String() string
	DecodedData() *ethabi.DecodedCallData
}

type EthereumTransferAssetsErc20TxKind added in v0.10.0

type EthereumTransferAssetsErc20TxKind struct {
	Arguments ethabi.ERC20TransferArguments
	Asset     OptionalAsset
	// contains filtered or unexported fields
}

func NewEthereumTransferAssetsErc20TxKind added in v0.10.0

func NewEthereumTransferAssetsErc20TxKind(decodedData ethabi.DecodedCallData, asset OptionalAsset, arguments ethabi.ERC20TransferArguments) *EthereumTransferAssetsErc20TxKind

func (*EthereumTransferAssetsErc20TxKind) DecodedData added in v0.10.0

func (*EthereumTransferAssetsErc20TxKind) String added in v0.10.0

type EthereumTransferWavesTxKind added in v0.10.0

type EthereumTransferWavesTxKind struct {
}

func NewEthereumTransferWavesTxKind added in v0.10.0

func NewEthereumTransferWavesTxKind() *EthereumTransferWavesTxKind

func (*EthereumTransferWavesTxKind) DecodedData added in v0.10.0

func (*EthereumTransferWavesTxKind) String added in v0.10.0

func (k *EthereumTransferWavesTxKind) String() string

type EthereumTxData added in v0.10.0

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

type EthereumTxType added in v0.10.0

type EthereumTxType byte

EthereumTxType is an ethereum transaction type.

const (
	EthereumLegacyTxType EthereumTxType = iota
	EthereumAccessListTxType
	EthereumDynamicFeeTxType
	UndefinedTxType
)

func (EthereumTxType) String added in v0.10.0

func (e EthereumTxType) String() string

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(Scheme) ([]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) GetSender added in v0.10.0

func (tx ExchangeWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *ExchangeWithProofs) MerkleBytes(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) (err 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(_ Scheme) (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(Scheme) ([]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) GetSender added in v0.10.0

func (tx ExchangeWithSig) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

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

func (*ExchangeWithSig) Sign added in v0.5.0

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

Sign 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(_ Scheme) (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 FrontierSigner added in v0.10.0

type FrontierSigner struct{}

func (FrontierSigner) ChainID added in v0.10.0

func (fs FrontierSigner) ChainID() *big.Int

func (FrontierSigner) Equal added in v0.10.0

func (fs FrontierSigner) Equal(s2 EthereumSigner) bool

func (FrontierSigner) Hash added in v0.10.0

Hash returns the hash to be signed by the sender. It does not uniquely identify the transaction.

func (FrontierSigner) Sender added in v0.10.0

func (FrontierSigner) SenderPK added in v0.10.0

func (FrontierSigner) SignatureValues added in v0.10.0

func (fs FrontierSigner) SignatureValues(tx *EthereumTransaction, sig []byte) (r, s, v *big.Int, err error)

SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.

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    WavesAddress
	SenderPK  crypto.PublicKey
	Timestamp uint64
	ID        *crypto.Digest
}

func NewFullScriptTransfer added in v0.3.0

func NewFullScriptTransfer(action *TransferScriptAction, sender WavesAddress, senderPK crypto.PublicKey, txID *crypto.Digest, timestamp uint64) (*FullScriptTransfer, error)

func NewFullScriptTransferFromPaymentAction added in v0.10.0

func NewFullScriptTransferFromPaymentAction(action *AttachedPaymentScriptAction, sender WavesAddress, senderPK crypto.PublicKey, txID *crypto.Digest, timestamp uint64) (*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 {
	// contains filtered or unexported fields
}

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

func NewFunctionCall added in v0.10.5

func NewFunctionCall(name string, args Arguments) FunctionCall

func (FunctionCall) Arguments added in v0.3.0

func (c FunctionCall) Arguments() Arguments

func (*FunctionCall) BinarySize added in v0.5.0

func (c *FunctionCall) BinarySize() int

func (FunctionCall) Default added in v0.3.0

func (c FunctionCall) Default() bool

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

func (c FunctionCall) Name() string

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.

func (FunctionCall) Valid added in v0.10.5

func (c FunctionCall) Valid() error

type Genesis

type Genesis struct {
	Type      TransactionType   `json:"type"`
	Version   byte              `json:"version,omitempty"`
	ID        *crypto.Signature `json:"id,omitempty"`
	Signature *crypto.Signature `json:"signature,omitempty"`
	Timestamp uint64            `json:"timestamp"`
	Recipient WavesAddress      `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 WavesAddress, 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(Scheme) ([]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(scheme Scheme) 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) GetSender added in v0.10.0

func (tx Genesis) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

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

func (*Genesis) Sign added in v0.5.0

func (tx *Genesis) Sign(scheme Scheme, _ 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(scheme Scheme) (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       PeerMessageID
	PayloadLength   uint32
	PayloadChecksum [headerChecksumLen]byte
}

func MakeHeader added in v0.3.0

func MakeHeader(contentID PeerMessageID, 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 HexBytes added in v0.10.0

type HexBytes []byte

func (HexBytes) Bytes added in v0.10.0

func (b HexBytes) Bytes() []byte

func (HexBytes) MarshalJSON added in v0.10.0

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

MarshalJSON writes HexBytes Value as JSON string

func (HexBytes) String added in v0.10.0

func (b HexBytes) String() string

String represents underlying bytes as Hex string with 0x prefix

func (*HexBytes) UnmarshalJSON added in v0.10.0

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

UnmarshalJSON reads HexBytes from JSON string

type HomesteadSigner added in v0.10.0

type HomesteadSigner struct{ FrontierSigner }

HomesteadSigner implements EthereumSigner using the homestead rules.

func (HomesteadSigner) ChainID added in v0.10.0

func (hs HomesteadSigner) ChainID() *big.Int

func (HomesteadSigner) Equal added in v0.10.0

func (hs HomesteadSigner) Equal(s2 EthereumSigner) bool

func (HomesteadSigner) Sender added in v0.10.0

func (HomesteadSigner) SenderPK added in v0.10.0

func (HomesteadSigner) SignatureValues added in v0.10.0

func (hs HomesteadSigner) SignatureValues(tx *EthereumTransaction, sig []byte) (r, s, v *big.Int, err error)

SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.

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) PayloadSize added in v0.10.0

func (e IntegerDataEntry) PayloadSize() int

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

UnmarshalValue reads binary representation of integer data entry value to the structure.

func (IntegerDataEntry) Valid added in v0.3.0

func (e IntegerDataEntry) Valid(forbidEmptyKey, utf16KeyLen bool) error

type InvokeExpressionTransactionWithProofs added in v0.10.0

type InvokeExpressionTransactionWithProofs struct {
	ID         *crypto.Digest   `json:"id,omitempty"`
	Type       TransactionType  `json:"type"`
	Version    byte             `json:"version,omitempty"`
	SenderPK   crypto.PublicKey `json:"senderPublicKey"`
	Fee        uint64           `json:"fee"`
	FeeAsset   OptionalAsset    `json:"feeAssetId"`
	Timestamp  uint64           `json:"timestamp,omitempty"`
	Proofs     *ProofsV1        `json:"proofs,omitempty"`
	Expression B64Bytes         `json:"expression,omitempty"`
}

func NewUnsignedInvokeExpressionWithProofs added in v0.10.0

func NewUnsignedInvokeExpressionWithProofs(v byte, senderPK crypto.PublicKey, expression B64Bytes, feeAsset OptionalAsset, fee, timestamp uint64) *InvokeExpressionTransactionWithProofs

NewUnsignedInvokeExpressionWithProofs creates new unsigned InvokeExpressionTransactionWithProofs transaction.

func (*InvokeExpressionTransactionWithProofs) BinarySize added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) BinarySize() int

func (*InvokeExpressionTransactionWithProofs) BodyMarshalBinary added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) BodyMarshalBinary(Scheme) ([]byte, error)

func (*InvokeExpressionTransactionWithProofs) GenerateID added in v0.10.0

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

func (InvokeExpressionTransactionWithProofs) GetFee added in v0.10.0

func (*InvokeExpressionTransactionWithProofs) GetID added in v0.10.0

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

func (InvokeExpressionTransactionWithProofs) GetSender added in v0.10.0

func (InvokeExpressionTransactionWithProofs) GetTimestamp added in v0.10.0

func (InvokeExpressionTransactionWithProofs) GetTypeInfo added in v0.10.0

func (InvokeExpressionTransactionWithProofs) GetVersion added in v0.10.0

func (*InvokeExpressionTransactionWithProofs) MarshalBinary added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) MarshalBinary(Scheme) ([]byte, error)

func (*InvokeExpressionTransactionWithProofs) MarshalSignedToProtobuf added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) MarshalToProtobuf added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) MerkleBytes added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) MerkleBytes(scheme Scheme) ([]byte, error)

func (*InvokeExpressionTransactionWithProofs) Sign added in v0.10.0

func (*InvokeExpressionTransactionWithProofs) ToProtobuf added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) ToProtobufSigned added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) UnmarshalBinary added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) UnmarshalBinary([]byte, Scheme) error

func (*InvokeExpressionTransactionWithProofs) UnmarshalFromProtobuf added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) UnmarshalSignedFromProtobuf added in v0.10.0

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

func (*InvokeExpressionTransactionWithProofs) Validate added in v0.10.0

func (*InvokeExpressionTransactionWithProofs) Verify added in v0.10.0

func (tx *InvokeExpressionTransactionWithProofs) Verify(scheme Scheme, publicKey crypto.PublicKey) (bool, 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"`
	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 byte, senderPK crypto.PublicKey, scriptRecipient Recipient, call FunctionCall, payments ScriptPayments, feeAsset OptionalAsset, fee, timestamp uint64) *InvokeScriptWithProofs

NewUnsignedInvokeScriptWithProofs creates new unsigned InvokeScriptWithProofs 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(scheme Scheme) ([]byte, 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) GetSender added in v0.10.0

func (tx InvokeScriptWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]byte, error)

MarshalBinary writes InvokeScriptWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

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

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(_ Scheme) (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) GetSender added in v0.10.0

func (i Issue) GetSender(scheme Scheme) (Address, error)

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 {
	Sender      *crypto.PublicKey
	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) GroupType added in v0.10.0

func (*IssueScriptAction) SenderPK added in v0.9.0

func (a *IssueScriptAction) SenderPK() *crypto.PublicKey

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"`
	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 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(scheme Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *IssueWithProofs) MerkleBytes(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(_ Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *IssueWithSig) MerkleBytes(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(_ Scheme) (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) (WavesAddress, 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) GetSender added in v0.10.0

func (l Lease) GetSender(scheme Scheme) (Address, error)

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(scheme Scheme) (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) GetSender added in v0.10.0

func (lc LeaseCancel) GetSender(scheme Scheme) (Address, error)

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 LeaseCancelScriptAction added in v0.9.0

type LeaseCancelScriptAction struct {
	Sender  *crypto.PublicKey
	LeaseID crypto.Digest
}

LeaseCancelScriptAction is an action that cancels previously created lease.

func (*LeaseCancelScriptAction) GroupType added in v0.10.0

func (*LeaseCancelScriptAction) SenderPK added in v0.9.0

func (a *LeaseCancelScriptAction) SenderPK() *crypto.PublicKey

func (*LeaseCancelScriptAction) ToProtobuf added in v0.9.0

type LeaseCancelWithProofs added in v0.5.0

type LeaseCancelWithProofs struct {
	Type    TransactionType `json:"type"`
	Version byte            `json:"version,omitempty"`
	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 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(scheme Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *LeaseCancelWithProofs) MerkleBytes(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(_ Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *LeaseCancelWithSig) MerkleBytes(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(_ Scheme) (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 LeaseInfo added in v0.9.0

type LeaseInfo struct {
	IsActive    bool
	LeaseAmount uint64
	Recipient   WavesAddress
	Sender      WavesAddress
}

type LeaseScriptAction added in v0.9.0

type LeaseScriptAction struct {
	Sender    *crypto.PublicKey
	ID        crypto.Digest
	Recipient Recipient
	Amount    int64
	Nonce     int64
}

LeaseScriptAction is an action to lease Waves to given account.

func (*LeaseScriptAction) GroupType added in v0.10.0

func (*LeaseScriptAction) SenderPK added in v0.9.0

func (a *LeaseScriptAction) SenderPK() *crypto.PublicKey

func (*LeaseScriptAction) ToProtobuf added in v0.9.0

func (a *LeaseScriptAction) ToProtobuf() (*g.InvokeScriptResult_Lease, error)

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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *LeaseWithProofs) MerkleBytes(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(scheme Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *LeaseWithSig) MerkleBytes(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(scheme Scheme) (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 (*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(Scheme) ([]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) GetSender added in v0.10.0

func (tx MassTransferWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *MassTransferWithProofs) MerkleBytes(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(scheme Scheme) (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
}

MicroBlockRequestMessage total block signature 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 NewOptionalAsset added in v0.10.0

func NewOptionalAsset(present bool, id crypto.Digest) OptionalAsset

func NewOptionalAssetFromBytes added in v0.2.0

func NewOptionalAssetFromBytes(b []byte) (*OptionalAsset, error)

NewOptionalAssetFromBytes parses bytes as crypto.Digest and returns OptionalAsset.

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 NewOptionalAssetWaves added in v0.9.0

func NewOptionalAssetWaves() OptionalAsset

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) ToDigest added in v0.10.0

func (a *OptionalAsset) ToDigest() *crypto.Digest

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
	GetPriceMode() OrderPriceMode
	GetOrderType() OrderType
	GetMatcherPK() crypto.PublicKey
	GetAssetPair() AssetPair
	GetPrice() uint64
	GetExpiration() uint64
	Valid() (bool, error)
	GetAmount() uint64
	GetTimestamp() uint64
	GetMatcherFee() uint64
	GetMatcherFeeAsset() OptionalAsset
	GetSenderPKBytes() []byte
	GetSender(scheme Scheme) (Address, error)
	GenerateID(scheme Scheme) error
	GetProofs() (*ProofsV1, error)
	Verify(Scheme) (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 (OrderBody) BinarySize added in v0.5.0

func (o OrderBody) BinarySize() int

func (OrderBody) GetSender added in v0.10.0

func (o OrderBody) GetSender(scheme Scheme) (Address, error)

func (OrderBody) GetSenderPKBytes added in v0.10.0

func (o OrderBody) GetSenderPKBytes() []byte

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 OrderPriceMode added in v0.10.0

type OrderPriceMode byte
const (
	OrderPriceModeDefault OrderPriceMode = iota
	OrderPriceModeFixedDecimals
	OrderPriceModeAssetDecimals
)

func (*OrderPriceMode) FromProtobuf added in v0.10.0

func (m *OrderPriceMode) FromProtobuf(gm g.Order_PriceMode) error

func (OrderPriceMode) MarshalJSON added in v0.10.0

func (m OrderPriceMode) MarshalJSON() ([]byte, error)

func (OrderPriceMode) String added in v0.10.0

func (m OrderPriceMode) String() string

func (OrderPriceMode) ToProtobuf added in v0.10.0

func (m OrderPriceMode) ToProtobuf() g.Order_PriceMode

func (*OrderPriceMode) UnmarshalJSON added in v0.10.0

func (m *OrderPriceMode) UnmarshalJSON(val []byte) error

func (OrderPriceMode) Valid added in v0.10.0

func (m OrderPriceMode) Valid(orderVersion byte) (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) GetPriceMode added in v0.10.0

func (o *OrderV1) GetPriceMode() OrderPriceMode

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) (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) GetPriceMode added in v0.10.0

func (o *OrderV2) GetPriceMode() OrderPriceMode

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) (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) GetPriceMode added in v0.10.0

func (o *OrderV3) GetPriceMode() OrderPriceMode

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) (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"`
	PriceMode       OrderPriceMode `json:"priceMode"`
	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, priceMode OrderPriceMode) *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) GetPriceMode added in v0.10.0

func (o *OrderV4) GetPriceMode() OrderPriceMode

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) Valid added in v0.10.0

func (o *OrderV4) Valid() (bool, error)

func (*OrderV4) Verify added in v0.5.0

func (o *OrderV4) Verify(scheme Scheme) (bool, error)

Verify checks that the order's signature is valid.

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 WavesAddress      `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 WavesAddress, 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(Scheme) ([]byte, error)

func (*Payment) GenerateID added in v0.3.0

func (tx *Payment) GenerateID(_ 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) GetSender added in v0.10.0

func (tx Payment) GetSender(scheme Scheme) (Address, 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(Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx Payment) MerkleBytes(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(_ Scheme) (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 PeerMessageID added in v0.10.0

type PeerMessageID byte
const (
	ContentIDGetPeers          PeerMessageID = 0x1
	ContentIDPeers             PeerMessageID = 0x2
	ContentIDGetSignatures     PeerMessageID = 0x14
	ContentIDSignatures        PeerMessageID = 0x15
	ContentIDGetBlock          PeerMessageID = 0x16
	ContentIDBlock             PeerMessageID = 0x17
	ContentIDScore             PeerMessageID = 0x18
	ContentIDTransaction       PeerMessageID = 0x19
	ContentIDInvMicroblock     PeerMessageID = 0x1A
	ContentIDCheckpoint        PeerMessageID = 0x64
	ContentIDMicroblockRequest PeerMessageID = 27
	ContentIDMicroblock        PeerMessageID = 28
	ContentIDPBBlock           PeerMessageID = 29
	ContentIDPBMicroBlock      PeerMessageID = 30
	ContentIDPBTransaction     PeerMessageID = 31
	ContentIDGetBlockIds       PeerMessageID = 32
	ContentIDBlockIds          PeerMessageID = 33
)

Constants for message IDs

type PeerMessageIDs added in v0.10.0

type PeerMessageIDs []PeerMessageID

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) ExtractSignature added in v0.10.0

func (p *ProofsV1) ExtractSignature() (crypto.Signature, error)

ExtractSignature tries to extract a signature from ProofsV1.Proofs slice.

func (*ProofsV1) IsSimpleSigned added in v0.10.0

func (p *ProofsV1) IsSimpleSigned() bool

IsSimpleSigned performs basics checks of signature correctness.

func (*ProofsV1) Len added in v0.10.0

func (p *ProofsV1) Len() int

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(key crypto.SecretKey, data []byte) error

Sign creates a signature and stores it as a proof at first 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(key crypto.PublicKey, data []byte) (bool, error)

Verify checks that the proof at first 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) (WavesAddress, 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) 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) LeaseCancelScriptActions added in v0.9.0

func (c *ProtobufConverter) LeaseCancelScriptActions(cancels []*g.InvokeScriptResult_LeaseCancel) ([]*LeaseCancelScriptAction, error)

func (*ProtobufConverter) LeaseScriptActions added in v0.9.0

func (c *ProtobufConverter) LeaseScriptActions(scheme byte, leases []*g.InvokeScriptResult_Lease) ([]*LeaseScriptAction, 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 RLPDecoder added in v0.10.0

type RLPDecoder interface {
	DecodeRLP([]byte) error
}

type RLPEncoder added in v0.10.0

type RLPEncoder interface {
	EncodeRLP(io.Writer) error
}

type Recipient added in v0.2.0

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

Recipient could be an Alias or an WavesAddress.

func NewRecipientFromAddress added in v0.2.0

func NewRecipientFromAddress(a WavesAddress) 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) Address added in v0.2.0

func (r Recipient) Address() *WavesAddress

func (Recipient) Alias added in v0.2.0

func (r Recipient) Alias() *Alias

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) EqAddr added in v0.10.4

func (r Recipient) EqAddr(addr WavesAddress) (bool, error)

func (Recipient) EqAlias added in v0.10.4

func (r Recipient) EqAlias(alias Alias) (bool, error)

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(scheme Scheme) (bool, error)

Valid checks that either an WavesAddress 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) GetSender added in v0.10.0

func (r Reissue) GetSender(scheme Scheme) (Address, error)

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 {
	Sender     *crypto.PublicKey
	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) GroupType added in v0.10.0

func (*ReissueScriptAction) SenderPK added in v0.9.0

func (a *ReissueScriptAction) SenderPK() *crypto.PublicKey

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"`
	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 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(scheme Scheme) ([]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(scheme Scheme) ([]byte, error)

MarshalBinary writes ReissueWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *ReissueWithProofs) MerkleBytes(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 byte 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(_ Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *ReissueWithSig) MerkleBytes(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(_ Scheme) (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 Reward added in v0.10.5

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

func NewReward added in v0.10.5

func NewReward(address WavesAddress, amount uint64) Reward

func (*Reward) Address added in v0.10.5

func (r *Reward) Address() WavesAddress

func (*Reward) Amount added in v0.10.5

func (r *Reward) Amount() uint64

type Rewards added in v0.10.5

type Rewards []Reward

func (*Rewards) Sorted added in v0.10.5

func (r *Rewards) Sorted() Rewards

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) IsEmpty added in v0.10.0

func (s Script) IsEmpty() bool

IsEmpty checks that script bytes slice is nil or slice length equals zero

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 {
	GroupType() ScriptActionGroupType
	SenderPK() *crypto.PublicKey
	// contains filtered or unexported methods
}

ScriptAction common interface of script invocation actions.

type ScriptActionGroupType added in v0.10.0

type ScriptActionGroupType byte

type ScriptBasicInfo added in v0.10.2

type ScriptBasicInfo struct {
	PK             crypto.PublicKey
	ScriptLen      uint32
	LibraryVersion ast.LibraryVersion
	HasVerifier    bool
	IsDApp         bool
}

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
	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
	Leases       []*LeaseScriptAction
	LeaseCancels []*LeaseCancelScriptAction
	ErrorMsg     ScriptErrorMessage
}

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"`
	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 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(scheme Scheme) ([]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) GetSender added in v0.10.0

func (tx SetAssetScriptWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]byte, error)

MarshalBinary writes SetAssetScriptWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *SetAssetScriptWithProofs) MerkleBytes(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(_ Scheme) (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"`
	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, 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(scheme Scheme) ([]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) GetSender added in v0.10.0

func (tx SetScriptWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]byte, error)

MarshalBinary writes SetScriptWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *SetScriptWithProofs) MerkleBytes(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(_ Scheme) (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 {
	Sender  *crypto.PublicKey
	AssetID crypto.Digest // assetId
	MinFee  int64         // minSponsoredAssetFee
}

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

func (*SponsorshipScriptAction) GroupType added in v0.10.0

func (*SponsorshipScriptAction) SenderPK added in v0.9.0

func (a *SponsorshipScriptAction) SenderPK() *crypto.PublicKey

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 set up 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(Scheme) ([]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) GetSender added in v0.10.0

func (tx SponsorshipWithProofs) GetSender(scheme Scheme) (Address, 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(scheme Scheme) ([]byte, error)

MarshalBinary writes SponsorshipWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *SponsorshipWithProofs) MerkleBytes(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 byte 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(_ Scheme) (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 StateActionsCounter added in v0.10.5

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

func (*StateActionsCounter) NextIssueActionNumber added in v0.10.5

func (c *StateActionsCounter) NextIssueActionNumber() uint32

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 StateHashDebug added in v0.10.4

type StateHashDebug struct {
	Height  uint64 `json:"height,omitempty"`
	Version string `json:"version,omitempty"`
	// contains filtered or unexported fields
}

func NewStateHashJSDebug added in v0.10.4

func NewStateHashJSDebug(s StateHash, h uint64, v string) StateHashDebug

func (StateHashDebug) GetStateHash added in v0.10.4

func (s StateHashDebug) GetStateHash() *StateHash

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) PayloadSize added in v0.10.0

func (e StringDataEntry) PayloadSize() int

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(forbidEmptyKey, utf16KeyLen bool) 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

ToUint64 converts TCPAddr to uint64 number.

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
	// 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)
	GetSender(scheme Scheme) (Address, error)
	GetFee() uint64
	GetTimestamp() uint64

	// Validate checks 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(scheme Scheme) (Transaction, error)

	// GenerateID sets transaction ID.
	// For most transactions 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

	// MerkleBytes returns array of bytes for block's merle root calculation
	MerkleBytes(scheme Scheme) ([]byte, error)

	// MarshalBinary functions for custom binary format serialization.
	// MarshalBinary() is analogous to MarshalSignedToProtobuf() for Protobuf.
	MarshalBinary(Scheme) ([]byte, error)
	// UnmarshalBinary parse Bytes without signature.
	UnmarshalBinary([]byte, Scheme) error
	// BodyMarshalBinary is analogous to MarshalToProtobuf() for Protobuf.
	BodyMarshalBinary(Scheme) ([]byte, error)
	// BinarySize gets 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)

GuessTransactionType guesses 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
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
	EthereumMetamaskTransaction                            // 18 - EthereumMetamaskTransaction is a transaction which is received from metamask
	InvokeExpressionTransaction                            // 19 - InvokeExpressionTransaction
)

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(scheme Scheme) ([]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, scheme Scheme) (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) GetSender added in v0.10.0

func (tr Transfer) GetSender(scheme Scheme) (Address, error)

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(scheme Scheme) (bool, error)

type TransferScriptAction added in v0.5.0

type TransferScriptAction struct {
	Sender    *crypto.PublicKey
	Recipient Recipient
	Amount    int64
	Asset     OptionalAsset
}

TransferScriptAction is an action to emit transfer of asset.

func (*TransferScriptAction) GroupType added in v0.10.0

func (*TransferScriptAction) SenderPK added in v0.9.0

func (a *TransferScriptAction) SenderPK() *crypto.PublicKey

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(Scheme) ([]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(scheme Scheme) ([]byte, error)

MarshalBinary writes TransferWithProofs transaction to its byte 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) MerkleBytes added in v0.10.0

func (tx *TransferWithProofs) MerkleBytes(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 byte 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(scheme Scheme) (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(Scheme) ([]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(scheme Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *TransferWithSig) MerkleBytes(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(scheme Scheme) (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

TxFailureReason indicates 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)

WriteTo writes U8String into io.Writer w in 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"`
	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 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(Scheme) ([]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) GetSender added in v0.10.0

func (tx UpdateAssetInfoWithProofs) GetSender(scheme Scheme) (Address, 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(Scheme) ([]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) MerkleBytes added in v0.10.0

func (tx *UpdateAssetInfoWithProofs) MerkleBytes(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(_ []byte, _ 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 (*UpdateAssetInfoWithProofs) Verify added in v0.5.0

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

type Version

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

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 (v Version) Cmp(other Version) int

func (Version) CmpMinor added in v0.8.1

func (v Version) CmpMinor(other Version) int

CmpMinor compares 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) Major

func (v Version) Major() uint32

func (Version) MarshalJSON added in v0.3.0

func (v Version) MarshalJSON() ([]byte, error)

func (Version) Minor

func (v Version) Minor() uint32

func (Version) Patch

func (v Version) Patch() uint32

func (*Version) ReadFrom added in v0.3.0

func (v *Version) ReadFrom(r io.Reader) (int64, error)

func (Version) String added in v0.3.0

func (v Version) String() string

func (Version) WriteTo added in v0.3.0

func (v Version) WriteTo(writer io.Writer) (int64, error)

type WavesAddress added in v0.10.0

type WavesAddress [WavesAddressSize]byte

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

func MustAddressFromString added in v0.8.0

func MustAddressFromString(s string) WavesAddress

func NewAddressFromBytes

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

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

func NewAddressFromBytesChecked added in v0.10.4

func NewAddressFromBytesChecked(scheme Scheme, b []byte) (WavesAddress, error)

NewAddressFromBytesChecked creates an WavesAddress from the slice of bytes and checks that the result address is a valid address with valid scheme.

func NewAddressFromPublicKey

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

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

func NewAddressFromString

func NewAddressFromString(s string) (WavesAddress, error)

NewAddressFromString creates an WavesAddress 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) (WavesAddress, error)

NewAddressLikeFromAnyBytes produces an WavesAddress from given scheme and bytes.

func RebuildAddress added in v0.3.0

func RebuildAddress(scheme Scheme, bodyBytes []byte) (WavesAddress, error)

func (WavesAddress) Body added in v0.10.0

func (a WavesAddress) Body() []byte

func (WavesAddress) Bytes added in v0.10.0

func (a WavesAddress) Bytes() []byte

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

func (WavesAddress) Equal added in v0.10.0

func (a WavesAddress) Equal(address Address) bool

func (*WavesAddress) EthereumAddress added in v0.10.0

func (a *WavesAddress) EthereumAddress() EthereumAddress

func (WavesAddress) ID added in v0.10.0

func (a WavesAddress) ID() AddressID

func (WavesAddress) MarshalJSON added in v0.10.0

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

MarshalJSON is the custom JSON marshal function for the WavesAddress.

func (WavesAddress) MarshalText added in v0.10.4

func (a WavesAddress) MarshalText() (text []byte, err error)

func (WavesAddress) Scheme added in v0.10.4

func (a WavesAddress) Scheme() Scheme

func (WavesAddress) String added in v0.10.0

func (a WavesAddress) String() string

String produces the BASE58 string representation of the WavesAddress.

func (WavesAddress) ToWavesAddress added in v0.10.0

func (a WavesAddress) ToWavesAddress(_ Scheme) (WavesAddress, error)

func (*WavesAddress) UnmarshalJSON added in v0.10.0

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

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

func (*WavesAddress) UnmarshalText added in v0.10.4

func (a *WavesAddress) UnmarshalText(text []byte) error

func (*WavesAddress) Valid added in v0.10.0

func (a *WavesAddress) Valid(scheme Scheme) (bool, error)

Valid checks that scheme, version and checksum of the WavesAddress are correct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL