-
Notifications
You must be signed in to change notification settings - Fork 13
/
subscriber.go
31 lines (26 loc) · 999 Bytes
/
subscriber.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
package relay
import (
"context"
"github.com/neutron-org/neutron/x/interchainqueries/types"
neutrontypes "github.com/neutron-org/neutron/x/interchainqueries/types"
)
// Subscriber is an interface that subscribes to Neutron and provides chain data in real time.
type Subscriber interface {
// Subscribe starts sending neutrontypes.RegisteredQuery values to the tasks channel when
// respective queries need to be updated.
Subscribe(ctx context.Context, tasks chan neutrontypes.RegisteredQuery) error
}
// MessageKV contains params of a KV interchain query.
type MessageKV struct {
// QueryId is the ID of the query.
QueryId uint64
// KVKeys is the query parameter that describes keys list to be retrieved.
KVKeys types.KVKeys
}
// MessageTX contains params of a TX interchain query.
type MessageTX struct {
// QueryId is the ID of the query.
QueryId uint64
// TransactionsFilter is the query parameter that describes conditions for transactions search.
TransactionsFilter string
}