blockchain

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABIEvent

type ABIEvent struct {
	Type      string     `json:"type"`
	Name      string     `json:"name"`
	Inputs    []ABIInput `json:"inputs"`
	Anonymous bool       `json:"anonymous,omitempty"`
}

ABIEvent represents a generic event structure

type ABIInput

type ABIInput struct {
	Indexed      bool   `json:"indexed"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	InternalType string `json:"internalType,omitempty"`
}

ABIInput represents an event input parameter

type ABIManager

type ABIManager struct {
	// contains filtered or unexported fields
}

ABIManager handles loading and managing multiple contract ABIs

func NewABIManager

func NewABIManager() *ABIManager

NewABIManager creates a new ABI manager

func (*ABIManager) GetABI

func (am *ABIManager) GetABI(contractName string) (*abi.ABI, error)

GetABI returns the ABI for a specific contract

func (*ABIManager) GetEventSignature

func (am *ABIManager) GetEventSignature(contractName, eventName string) (string, error)

GetEventSignature returns the event signature for a specific contract and event

func (*ABIManager) ListContracts

func (am *ABIManager) ListContracts() []string

ListContracts returns all loaded contract names

func (*ABIManager) ListEvents

func (am *ABIManager) ListEvents(contractName string) ([]string, error)

ListEvents returns all events for a specific contract

func (*ABIManager) LoadABIFromFile

func (am *ABIManager) LoadABIFromFile(contractName, filePath string) error

LoadABIFromFile loads an ABI from a JSON file

func (*ABIManager) LoadABIsFromDirectory

func (am *ABIManager) LoadABIsFromDirectory(dirPath string) error

LoadABIsFromDirectory loads all ABI files from a directory

type EventProcessor

type EventProcessor struct {
	// contains filtered or unexported fields
}

EventProcessor handles processing of blockchain events

func NewEventProcessor

func NewEventProcessor(abiManager *ABIManager, pool *pgxpool.Pool) *EventProcessor

NewEventProcessor creates a new event processor

func (*EventProcessor) GetABIManager

func (ep *EventProcessor) GetABIManager() *ABIManager

GetABIManager returns the ABI manager

func (*EventProcessor) ProcessLog

func (ep *EventProcessor) ProcessLog(vLog types.Log, contractName string) error

ProcessLog processes a single log entry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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