types

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: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTarget added in v0.5.0

type BaseTarget = uint64

type EmbeddedWallet added in v0.5.0

type EmbeddedWallet interface {
	SignTransactionWith(pk crypto.PublicKey, tx proto.Transaction) error
	Load(password []byte) error
	AccountSeeds() [][]byte
}

type Handler

type Handler interface {
	Handle()
}

Handler is an abstract function that called when an event happens.

type ID added in v0.5.0

type ID interface {
	ID() string
}

type InvRequester added in v0.5.0

type InvRequester interface {
	Request(MessageSender, []byte)
}

type MessageSender added in v0.5.0

type MessageSender interface {
	SendMessage(proto.Message)
}

type Miner added in v0.5.0

type Miner interface {
	MineKeyBlock(ctx context.Context, t proto.Timestamp, k proto.KeyPair, parent proto.BlockID, baseTarget BaseTarget, gs []byte, vrf []byte) (*proto.Block, proto.MiningLimits, error)
}

type MinerConsensus added in v0.5.0

type MinerConsensus interface {
	IsMiningAllowed() bool
}

type Scheduler

type Scheduler interface {
	Reschedule()
}

type ScoreSender added in v0.5.0

type ScoreSender interface {
	Priority()
	NonPriority()
}

type SmartState

type SmartState interface {
	NewestScriptPKByAddr(addr proto.WavesAddress) (crypto.PublicKey, error)
	AddingBlockHeight() (uint64, error)
	NewestTransactionByID([]byte) (proto.Transaction, error)
	NewestTransactionHeightByID([]byte) (uint64, error)
	NewestScriptByAccount(account proto.Recipient) (*ast.Tree, error)
	NewestScriptBytesByAccount(account proto.Recipient) (proto.Script, error)
	NewestRecipientToAddress(recipient proto.Recipient) (proto.WavesAddress, error)
	NewestAddrByAlias(alias proto.Alias) (proto.WavesAddress, error)
	NewestLeasingInfo(id crypto.Digest) (*proto.LeaseInfo, error)
	IsStateUntouched(account proto.Recipient) (bool, error)
	NewestAssetBalance(account proto.Recipient, assetID crypto.Digest) (uint64, error)
	NewestWavesBalance(account proto.Recipient) (uint64, error)
	NewestFullWavesBalance(account proto.Recipient) (*proto.FullWavesBalance, error)
	RetrieveNewestIntegerEntry(account proto.Recipient, key string) (*proto.IntegerDataEntry, error)
	RetrieveNewestBooleanEntry(account proto.Recipient, key string) (*proto.BooleanDataEntry, error)
	RetrieveNewestStringEntry(account proto.Recipient, key string) (*proto.StringDataEntry, error)
	RetrieveNewestBinaryEntry(account proto.Recipient, key string) (*proto.BinaryDataEntry, error)
	NewestAssetIsSponsored(assetID crypto.Digest) (bool, error)
	NewestAssetInfo(assetID crypto.Digest) (*proto.AssetInfo, error)
	NewestFullAssetInfo(assetID crypto.Digest) (*proto.FullAssetInfo, error)
	NewestScriptByAsset(assetID crypto.Digest) (*ast.Tree, error)
	NewestBlockInfoByHeight(height proto.Height) (*proto.BlockInfo, error)

	EstimatorVersion() (int, error)
	IsNotFound(err error) bool

	// WavesBalanceProfile returns WavesBalanceProfile structure retrieved by proto.AddressID of an account.
	// This function always returns the newest available state of Waves balance of account.
	WavesBalanceProfile(id proto.AddressID) (*WavesBalanceProfile, error)

	// NewestAssetBalanceByAddressID returns the most actual asset balance by given proto.AddressID and
	// assets crypto.Digest.
	NewestAssetBalanceByAddressID(id proto.AddressID, asset crypto.Digest) (uint64, error)
}

type StateSync added in v0.5.0

type StateSync interface {
	Sync()
	SetEnabled(enabled bool)
	Close()
	Run(ctx context.Context)
}

type Subscribe added in v0.5.0

type Subscribe interface {
	Subscribe(p ID, responseMessage proto.Message) (chan proto.Message, func(), error)
	Receive(p ID, responseMessage proto.Message) bool
}

type Time added in v0.5.0

type Time interface {
	Now() time.Time
}

type TransactionWithBytes

type TransactionWithBytes struct {
	T proto.Transaction
	B []byte
}

type UtxPool

type UtxPool interface {
	Add(t proto.Transaction) error
	AddWithBytes(t proto.Transaction, b []byte) error
	Exists(t proto.Transaction) bool
	Pop() *TransactionWithBytes
	AllTransactions() []*TransactionWithBytes
	Count() int
	ExistsByID(id []byte) bool
}

UtxPool storage interface

type WavesBalanceProfile added in v0.10.0

type WavesBalanceProfile struct {
	Balance    uint64
	LeaseIn    int64
	LeaseOut   int64
	Generating uint64
}

WavesBalanceProfile contains essential parts of Waves balance and must be used to pass this information if SmartState only.

Jump to

Keyboard shortcuts

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