-
Notifications
You must be signed in to change notification settings - Fork 18
/
client.go
71 lines (58 loc) · 1.49 KB
/
client.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package types
import (
"google.golang.org/grpc"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
)
type TxManager interface {
TmQuery
BuildAndSend(msg []Msg, baseTx BaseTx) (ResultTx, Error)
SendBatch(msgs Msgs, baseTx BaseTx) ([]ResultTx, Error)
}
type Queries interface {
StoreQuery
AccountQuery
TmQuery
}
type GRPCClient interface {
GenConn() (*grpc.ClientConn, error)
}
type ParamQuery interface {
QueryParams(module string, res Response) Error
}
type StoreQuery interface {
QueryWithResponse(path string, data interface{}, result Response) error
Query(path string, data interface{}) ([]byte, error)
QueryStore(key HexBytes, storeName string, height int64, prove bool) (abci.ResponseQuery, error)
}
type AccountQuery interface {
QueryAccount(address string) (BaseAccount, Error)
QueryAddress(name, password string) (AccAddress, Error)
}
type TmQuery interface {
QueryTx(hash string) (ResultQueryTx, error)
QueryTxs(builder *EventQueryBuilder, page, size int) (ResultSearchTxs, error)
QueryBlock(height int64) (BlockDetail, error)
}
type TokenManager interface {
QueryToken(denom string) (Token, error)
SaveTokens(tokens ...Token)
}
type TokenConvert interface {
ToMinCoin(coin ...DecCoin) (Coins, Error)
ToMainCoin(coin ...Coin) (DecCoins, Error)
}
type Logger interface {
Logger() log.Logger
SetLogger(log.Logger)
}
type BaseClient interface {
TxManager
TokenManager
KeyManager
Queries
TokenConvert
TmClient
Logger
GRPCClient
}