inventory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineHandler

type EngineHandler interface {
	ResolveWallet(name string) (accountID int, walletID int, walletType common.WalletType, err error)
	NotifyReady()
}

EngineHandler defines what the inventory actor needs from the ledger engine.

type InventoryActor

type InventoryActor struct {
	actor.ActorBase
	// contains filtered or unexported fields
}

InventoryActor is an actor owned by the ledger Engine. Each instance manages exactly one wallet, filtering incoming events by walletID. It writes balance state directly to cache for other engines/strategies to read.

func NewInventoryActor

func NewInventoryActor(handler EngineHandler) *InventoryActor

NewInventoryActor creates a new InventoryActor for the given engine handler.

func (*InventoryActor) Handle

func (b *InventoryActor) Handle(ev msgbus.Event, bus *msgbus.MsgBus)

Handle processes events, filtering by this actor's wallet, and writes to cache.

func (*InventoryActor) OnInit

func (b *InventoryActor) OnInit(config map[string]any)

OnInit decodes the wallet config and resolves wallet identity from the catalog.

func (*InventoryActor) OnStart

func (b *InventoryActor) OnStart()

func (*InventoryActor) SetCache

func (b *InventoryActor) SetCache(c *cache.Cache)

SetCache injects the shared cache for balance writes.

func (*InventoryActor) SetCatalog

func (b *InventoryActor) SetCatalog(cat *catalog.Catalog)

SetCatalog injects the catalog for token name resolution.

type InventoryConfig

type InventoryConfig struct {
	Wallet string `yaml:"wallet"` // Wallet name to track (e.g. "bn-hephe-spot")
}

InventoryConfig contains configuration for a single inventory actor instance. Each inventory actor manages exactly one wallet.

Jump to

Keyboard shortcuts

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