Documentation ¶
Index ¶
- func StringifyArg(arg interface{}) (str string)
- type Contract
- func (c *Contract) AddEmittedAddr(addresses ...interface{})
- func (c *Contract) AddEmittedHash(hashes ...interface{})
- func (c *Contract) GenerateFilters() error
- func (c Contract) Init() *Contract
- func (c *Contract) PassesEventFilter(args map[string]string) bool
- func (c *Contract) WantedEventArg(arg string) bool
- func (c *Contract) WantedMethodArg(arg interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StringifyArg ¶
func StringifyArg(arg interface{}) (str string)
Types ¶
type Contract ¶
type Contract struct { Name string // Name of the contract Address string // Address of the contract Network string // Network on which the contract is deployed; default empty "" is Ethereum mainnet StartingBlock int64 // Starting block of the contract Abi string // Abi string ParsedAbi abi.ABI // Parsed abi Events map[string]types.Event // List of events to watch Methods []types.Method // List of methods to poll Filters map[string]filters.LogFilter // Map of event filters to their event names; used only for full sync watcher FilterArgs map[string]bool // User-input list of values to filter event logs for MethodArgs map[string]bool // User-input list of values to limit method polling to EmittedAddrs map[interface{}]bool // List of all unique addresses collected from converted event logs EmittedHashes map[interface{}]bool // List of all unique hashes collected from converted event logs CreateAddrList bool // Whether or not to persist address list to postgres CreateHashList bool // Whether or not to persist hash list to postgres Piping bool // Whether or not to pipe method results forward as arguments to subsequent methods }
Contract object to hold our contract data
func (*Contract) AddEmittedAddr ¶
func (c *Contract) AddEmittedAddr(addresses ...interface{})
Add event emitted address to our list if it passes filter and method polling is on
func (*Contract) AddEmittedHash ¶
func (c *Contract) AddEmittedHash(hashes ...interface{})
Add event emitted hash to our list if it passes filter and method polling is on
func (*Contract) GenerateFilters ¶
Use contract info to generate event filters - full sync contract watcher only
func (Contract) Init ¶
If we will be calling methods that use addr, hash, or byte arrays as arguments then we initialize maps to hold these types of values
func (*Contract) PassesEventFilter ¶
Returns true if any mapping value matches filtered for address or if no filter exists Used to check if an event log name-value mapping should be filtered or not
func (*Contract) WantedEventArg ¶
Returns true if address is in list of arguments to filter events for or if no filtering is specified
func (*Contract) WantedMethodArg ¶
Returns true if address is in list of arguments to poll methods with or if no filtering is specified