-
Notifications
You must be signed in to change notification settings - Fork 2
/
lcd_types.go
67 lines (58 loc) · 2.3 KB
/
lcd_types.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
package sacco
import (
sdkTypes "github.com/cosmos/cosmos-sdk/types"
)
// TxBody represents the body of a Cosmos transaction
// signed and ready to be sent over the LCD REST service.
type TxBody struct {
Tx SignedTransactionPayload `json:"tx"`
Mode string `json:"mode"`
}
// AccountData holds informations about the account number and
// sequence number of a Cosmos account.
type AccountData struct {
Result AccountDataResult `json:"result"`
}
// AccountDataResult is a wrapper struct for a call to auth/accounts/{address} LCD
// REST endpoint.
type AccountDataResult struct {
Value AccountDataValue `json:"value"`
}
// AccountDataValue represents the real data obtained by calling /auth/accounts/{address} LCD
// REST endpoint.
type AccountDataValue struct {
Address string `json:"address"`
AccountNumber int64 `json:"account_number"`
Sequence int64 `json:"sequence"`
}
// NodeInfo is the LCD REST response to a /node_info request,
// and contains the Network attribute (chain ID).
type NodeInfo struct {
Info struct {
Network string `json:"network"`
} `json:"node_info"`
}
// TxResponse represents whatever data the LCD REST service returns to atomicwallet
// after a transaction gets forwarded to it.
type TxResponse struct {
Height string `json:"height"`
TxHash string `json:"txhash"`
Code uint32 `json:"code,omitempty"`
Data string `json:"data,omitempty"`
RawLog string `json:"raw_log,omitempty"`
Logs sdkTypes.ABCIMessageLogs `json:"logs,omitempty"`
Info string `json:"info,omitempty"`
GasWanted string `json:"gas_wanted,omitempty"`
GasUsed string `json:"gas_used,omitempty"`
Codespace string `json:"codespace,omitempty"`
Tx sdkTypes.Tx `json:"tx,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
// DEPRECATED: Remove in the next next major release in favor of using the
// ABCIMessageLog.Events field.
Events sdkTypes.StringEvents `json:"events,omitempty"`
}
// Error represents a JSON encoded error message sent whenever something
// goes wrong during the handler processing.
type Error struct {
Error string `json:"error,omitempty"`
}