forked from irisnet/irishub-sdk-go
/
client.go
60 lines (49 loc) · 1.22 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
package types
import (
"github.com/junjie-bianjie/irishub-sdk-go/utils/log"
)
type TxManager interface {
BuildAndSend(msg []Msg, baseTx BaseTx) (ResultTx, Error)
SendMsgBatch(msgs Msgs, baseTx BaseTx) ([]ResultTx, Error)
Broadcast(signedTx StdTx, mode BroadcastMode) (ResultTx, Error)
}
type Queries interface {
StoreQuery
AccountQuery
TxQuery
ParamQuery
}
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)
}
type AccountQuery interface {
QueryAccount(address string) (BaseAccount, Error)
QueryAddress(name string) (AccAddress, Error)
}
type TxQuery interface {
QueryTx(hash string) (ResultQueryTx, error)
QueryTxs(builder *EventQueryBuilder, page, size int) (ResultSearchTxs, error)
}
type TokenManager interface {
QueryToken(symbol string) (Token, error)
SaveTokens(tokens ...Token)
}
type TokenConvert interface {
ToMinCoin(coin ...Coin) (Coins, Error)
ToMainCoin(coin ...Coin) (Coins, Error)
}
type Logger interface {
Logger() *log.Logger
}
type BaseClient interface {
TxManager
TokenManager
Queries
TokenConvert
TmClient
Logger
}