/
logs.go
37 lines (28 loc) · 1012 Bytes
/
logs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package eth
import (
"context"
ethtypes "github.com/ethereum/go-ethereum/core/types"
ethfilters "github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/rpc"
)
func (svc *Service) NewFilter(crit ethfilters.FilterCriteria) (rpc.ID, error) {
return svc.filterAPI.NewFilter(crit)
}
func (svc *Service) NewBlockFilter() rpc.ID {
return svc.filterAPI.NewBlockFilter()
}
func (svc *Service) NewPendingTransactionFilter() rpc.ID {
return svc.filterAPI.NewPendingTransactionFilter()
}
func (svc *Service) UninstallFilter(id rpc.ID) bool {
return svc.filterAPI.UninstallFilter(id)
}
func (svc *Service) GetFilterChanges(id rpc.ID) (interface{}, error) {
return svc.filterAPI.GetFilterChanges(id)
}
func (svc *Service) GetFilterLogs(id rpc.ID) ([]*ethtypes.Log, error) {
return svc.filterAPI.GetFilterLogs(context.Background(), id)
}
func (svc *Service) GetLogs(crit ethfilters.FilterCriteria) ([]*ethtypes.Log, error) {
return svc.filterAPI.GetLogs(context.Background(), crit)
}