Documentation
¶
Overview ¶
Package watcher monitors the blockchain for deposits to the platform.
When USDC is sent to the platform address, it automatically credits the sender's agent balance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentChecker ¶
AgentChecker verifies if an address is a registered agent
type BalanceCreditor ¶
type BalanceCreditor interface {
Deposit(ctx context.Context, agentAddr, amount, txHash string) error
}
BalanceCreditor credits agent balances
type Config ¶
type Config struct {
RPCURL string
USDCContract common.Address
PlatformAddress common.Address
PollInterval time.Duration
StartBlock uint64 // 0 = latest
}
Config for the deposit watcher
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors for incoming USDC deposits
func New ¶
func New(cfg Config, creditor BalanceCreditor, checker AgentChecker, logger *slog.Logger) (*Watcher, error)
New creates a new deposit watcher
Click to show internal directories.
Click to hide internal directories.