types

package
v0.0.0-...-d56c475 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

  • Copyright (c) IBAX. All rights reserved.
  • See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------

Index

Constants

View Source
const (
	FirstBlockTxType = iota + 1
	StopNetworkTxType
	SmartContractTxType
	DelayTxType
	UtxoTxType
	TransferSelfTxType
)

Transaction types.

Variables

This section is empty.

Functions

func ConvertMap

func ConvertMap(in any) any

Types

type Header struct {
	ID          int
	EcosystemID int64
	KeyID       int64
	Time        int64
	NetworkID   int64
	PublicKey   []byte
}

Header is contain header data

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

Link represents a node of doubly linked list

type Map

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

Map holds the elements in go's native map, also maintains the head and tail link to keep the elements in insertion order

func LoadMap

func LoadMap(init map[string]any) (ret *Map)

LoadMap instantiates a linked hash map and initializing it from map[string]any.

func NewMap

func NewMap() *Map

NewMap instantiates a linked hash map.

func (*Map) Get

func (m *Map) Get(key string) (value any, found bool)

Get searches the element in the map by key and returns its value or nil if key doesn't exists. Second return parameter is true if key was found, otherwise false.

func (*Map) MarshalJSON

func (m *Map) MarshalJSON() ([]byte, error)

func (*Map) Set

func (m *Map) Set(key string, value any)

Put inserts an element into the map.

func (*Map) Size

func (m *Map) Size() int

Size returns number of elements in the map.

func (*Map) String

func (m *Map) String() string

String returns a string representation of container

type Notifications

type Notifications interface {
	AddAccounts(ecosystem int64, accounts ...string)
	AddRoles(ecosystem int64, roles ...int64)
	Size() int
	Send()
}

type SmartTransaction

type SmartTransaction struct {
	*Header
	MaxSum       string
	PayOver      string
	Lang         string
	Expedite     string
	SignedBy     int64
	TransferSelf *TransferSelf
	UTXO         *UTXO
	Params       map[string]any
}

SmartTransaction is storing smart contract data

func (SmartTransaction) Hash

func (t SmartTransaction) Hash() ([]byte, error)

func (*SmartTransaction) Marshal

func (s *SmartTransaction) Marshal() ([]byte, error)

func (*SmartTransaction) TxType

func (s *SmartTransaction) TxType() byte

func (*SmartTransaction) Unmarshal

func (s *SmartTransaction) Unmarshal(buffer []byte) error

func (*SmartTransaction) Validate

func (txSmart *SmartTransaction) Validate() error

func (*SmartTransaction) WithPrivate

func (s *SmartTransaction) WithPrivate(privateKey []byte, internal bool) error

type TransferSelf

type TransferSelf struct {
	Value  string
	Source string
	Target string
}

type UTXO

type UTXO struct {
	ToID    int64
	Value   string
	Comment string
}

UTXO Transfer

Jump to

Keyboard shortcuts

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