/
hermes_types.go
109 lines (88 loc) · 2.79 KB
/
hermes_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package hermes
// ClientCreationResponse contains the minimum required values to extract the client id from the hermes response.
type ClientCreationResponse struct {
Result CreateClientResult `json:"result"`
}
type CreateClient struct {
ClientID string `json:"client_id"`
ClientType string `json:"client_type"`
}
type CreateClientResult struct {
CreateClient CreateClient `json:"CreateClient"`
}
// ConnectionResponse contains the minimum required values to extract the connection id from both sides.
type ConnectionResponse struct {
Result ConnectionResult `json:"result"`
}
type ConnectionResult struct {
ASide ConnectionSide `json:"a_side"`
BSide ConnectionSide `json:"b_side"`
}
type ConnectionSide struct {
ConnectionID string `json:"connection_id"`
}
// ChannelCreationResponse contains the minimum required values to extract the channel ids from a hermes response.
type ChannelCreationResponse struct {
Result CreateChannelResult `json:"result"`
}
type CreateChannelResult struct {
ASide ChannelSide `json:"a_side"`
BSide ChannelSide `json:"b_side"`
}
type ChannelSide struct {
ChannelID string `json:"channel_id"`
}
// ChannelOutputResult contains the minimum required channel values.
type ChannelOutputResult struct {
Result []ChannelResult `json:"result"`
}
type ChannelResult struct {
ChannelEnd ChannelEnd `json:"channel_end"`
CounterPartyChannelEnd ChannelEnd `json:"counterparty_channel_end"`
}
type ChannelEnd struct {
ConnectionHops []string `json:"connection_hops"`
Ordering string `json:"ordering"`
State string `json:"state"`
Version string `json:"version"`
Remote ChannelAndPortId `json:"remote"`
}
type ChannelAndPortId struct {
ChannelID string `json:"channel_id"`
PortID string `json:"port_id"`
}
type ConnectionQueryResult struct {
Result []Result `json:"result"`
Status string `json:"status"`
}
type Counterparty struct {
ClientID string `json:"client_id"`
ConnectionID string `json:"connection_id"`
Prefix string `json:"prefix"`
}
type DelayPeriod struct {
Nanos int `json:"nanos"`
Secs int `json:"secs"`
}
type Versions struct {
Features []string `json:"features"`
Identifier string `json:"identifier"`
}
type ConnectionEnd struct {
ClientID string `json:"client_id"`
Counterparty Counterparty `json:"counterparty"`
DelayPeriod DelayPeriod `json:"delay_period"`
State string `json:"state"`
Versions []Versions `json:"versions"`
}
type Result struct {
ConnectionEnd ConnectionEnd `json:"connection_end"`
ConnectionID string `json:"connection_id"`
}
type ClientQueryResult struct {
ClientResult []ClientResult `json:"result"`
}
type ClientResult struct {
ChainID string `json:"chain_id"`
ClientID string `json:"client_id"`
}