mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
accounts/abi/bind/v2: add ContractInstance constructor
This commit is contained in:
parent
0e856b512a
commit
077556859c
1 changed files with 4 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ type ContractInstance struct {
|
|||
abi abi.ABI
|
||||
}
|
||||
|
||||
func NewContractInstance(addr common.Address, backend ContractBackend, abi abi.ABI) *ContractInstance {
|
||||
return &ContractInstance{addr, backend, abi}
|
||||
}
|
||||
|
||||
// FilterEvents returns an EventIterator instance for filtering historical events based on the event id and a block range.
|
||||
func FilterEvents[T any](instance *ContractInstance, opts *FilterOpts, eventName string, unpack func(*types.Log) (*T, error), topics ...[]any) (*EventIterator[T], error) {
|
||||
backend := instance.Backend
|
||||
|
|
|
|||
Loading…
Reference in a new issue