Documentation
¶
Index ¶
Constants ¶
const Chain = "algorand"
Chain identifier for Algorand.
Variables ¶
var ErrReorgDetected = errors.New("reorg detected")
ErrReorgDetected signals that the chain rewound; caller should restart from the updated cursor.
Functions ¶
This section is empty.
Types ¶
type AlgodClient ¶
type AlgodClient interface {
Status() statusGetter
BlockRaw(round uint64) blockGetter
GetBlockHash(round uint64) blockHashGetter
}
AlgodClient is the minimal subset of the algod client we need.
func NewAlgodClient ¶
func NewAlgodClient(url string) (AlgodClient, error)
NewAlgodClient constructs a real algod client.
type NormalizedEvent ¶
type NormalizedEvent struct {
Chain string
SourceID string
RuleID string
Height uint64
Hash string
TxHash string
AppID uint64
Name string
Args map[string]any
}
NormalizedEvent represents a decoded on-chain event in a uniform shape.
type RuleMatcher ¶
type RuleMatcher struct {
// contains filtered or unexported fields
}
RuleMatcher filters Algorand transactions for a given rule.
func NewRuleMatcher ¶
func NewRuleMatcher(rule config.Rule) (*RuleMatcher, error)
NewRuleMatcher builds a matcher for Algorand rules.
func (*RuleMatcher) MatchTxn ¶
func (m *RuleMatcher) MatchTxn(tx sdk.Transaction, apply sdk.ApplyData) (*NormalizedEvent, bool, error)
MatchTxn inspects a transaction and returns a normalized event when matched.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner processes Algorand rounds with confirmation safety.
func NewScanner ¶
func NewScanner(client AlgodClient, store *storage.Store, source config.Source, confirmations uint64, rules []config.Rule) (*Scanner, error)
NewScanner builds a scanner for an Algorand source and its rules.
func (*Scanner) ProcessNext ¶
func (s *Scanner) ProcessNext(ctx context.Context) ([]NormalizedEvent, error)
ProcessNext handles the next eligible round (respecting confirmations) and returns matched events. On success advances the cursor. On reorg returns ErrReorgDetected after rewinding.