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 ¶
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.