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) 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)
StringifyArg resolves a method argument type to string type
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 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{})
AddEmittedAddr adds event emitted addresses to our list if it passes filter and method polling is on
func (*Contract) AddEmittedHash ¶
func (c *Contract) AddEmittedHash(hashes ...interface{})
AddEmittedHash adds event emitted hashes to our list if it passes filter and method polling is on
func (Contract) Init ¶
Init initializes a contract object 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 ¶
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 ¶
WantedEventArg returns true if address is in list of arguments to filter events for or if no filtering is specified
func (*Contract) WantedMethodArg ¶
WantedMethodArg returns true if address is in list of arguments to poll methods with or if no filtering is specified