From 780dd76746513b4215cf93eff2e02d16338e96a6 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Sun, 15 Dec 2024 20:59:55 +0700 Subject: [PATCH] add some docs --- accounts/abi/bind/v2/lib.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accounts/abi/bind/v2/lib.go b/accounts/abi/bind/v2/lib.go index ae8cf91c1d..50237839bc 100644 --- a/accounts/abi/bind/v2/lib.go +++ b/accounts/abi/bind/v2/lib.go @@ -25,13 +25,14 @@ import ( "github.com/ethereum/go-ethereum/event" ) -// TODO: this will be generated as part of the bindings, contain the ABI (or metadata object?) and errors +// ContractInstance represents a contract deployed on-chain that can be interacted with (filter for past logs, watch +// for new logs, call, transact). type ContractInstance struct { Address common.Address Backend bind.ContractBackend } -// TODO: adding docs soon (jwasinger) +// 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 *bind.FilterOpts, eventID common.Hash, unpack func(*types.Log) (*T, error), topics ...[]any) (*EventIterator[T], error) { backend := instance.Backend c := bind.NewBoundContract(instance.Address, abi.ABI{}, backend, backend, backend)