-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstructs.go
221 lines (180 loc) · 5.16 KB
/
structs.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
// Copyright 2016 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package wsapi
import (
"github.com/FactomProject/factom"
)
type TLSConfig struct {
TLSEnable bool
TLSKeyFile string
TLSCertFile string
}
// requests
type passphraseRequest struct {
Password string `json:"passphrase"`
Timeout int64 `json:"timeout"`
}
type addressRequest struct {
Address string `json:"address"`
}
type addressesRequest struct {
Addresses []string `json:"addresses"`
}
type importRequest struct {
Addresses []struct {
Secret string `json:"secret"`
} `json:"addresses"`
}
type importKoinifyRequest struct {
Words string `json:"words"`
}
type transactionRequest struct {
Name string `json:"tx-name"`
Force bool `json:"force"`
}
type signDataRequest struct {
Signer string `json:"signer"`
Data []byte `json:"data"`
}
type transactionValueRequest struct {
Name string `json:"tx-name"`
Address string `json:"address"`
Amount uint64 `json:"amount"`
}
type transactionAddressRequest struct {
Name string `json:"tx-name"`
Address string `json:"address"`
}
type txdbRequest struct {
TxID string `json:"txid,omitempty"`
Address string `json:"address,omitempty"`
Range struct {
Start int `json:"start"`
End int `json:"end"`
} `json:"range,omitempty"`
}
type entryRequest struct {
Entry factom.Entry `json:"entry"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
type chainRequest struct {
Chain factom.Chain `json:"chain"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
type identityKeyRequest struct {
Public string `json:"public"`
}
type importIdentityKeysRequest struct {
Keys []struct {
Secret string `json:"secret"`
} `json:"keys"`
}
type activeIdentityKeysRequest struct {
ChainID string `json:"chainid"`
Height *int64 `json:"height"`
}
type identityChainRequest struct {
Name []string `json:"name"`
PubKeys []string `json:"pubkeys"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
type identityKeyReplacementRequest struct {
ChainID string `json:"chainid"`
OldKey string `json:"oldkey"`
NewKey string `json:"newkey"`
SignerKey string `json:"signerkey"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
type identityAttributeRequest struct {
ReceiverChainID string `json:"receiver-chainid"`
DestinationChainID string `json:"destination-chainid"`
Attributes []factom.IdentityAttribute `json:"attributes"`
SignerKey string `json:"signerkey"`
SignerChainID string `json:"signer-chainid"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
type identityAttributeEndorsementRequest struct {
DestinationChainID string `json:"destination-chainid"`
EntryHash string `json:"entry-hash"`
SignerKey string `json:"signerkey"`
SignerChainID string `json:"signer-chainid"`
ECPub string `json:"ecpub"`
Force bool `json:"force"`
}
// responses
type addressResponse struct {
Public string `json:"public"`
Secret string `json:"secret"`
}
type multiAddressResponse struct {
Addresses []*addressResponse `json:"addresses"`
}
type balanceResponse struct {
CurrentHeight uint32 `json:"current-height"`
LastSavedHeight uint `json:"last-saved-height"`
Balances []interface{} `json:"balances"`
}
type multiBalanceResponse struct {
FactoidAccountBalances struct {
Ack int64 `json:"ack"`
Saved int64 `json:"saved"`
} `json:"fctaccountbalances"`
EntryCreditAccountBalances struct {
Ack int64 `json:"ack"`
Saved int64 `json:"saved"`
} `json:"ecaccountbalances"`
}
type walletBackupResponse struct {
Seed string `json:"wallet-seed"`
Addresses []*addressResponse `json:"addresses"`
IdentityKeys []*identityKeyResponse `json:"identity-keys"`
}
type multiTransactionResponse struct {
Transactions []*factom.Transaction `json:"transactions"`
}
type propertiesResponse struct {
WalletVersion string `json:"walletversion"`
WalletApiVersion string `json:"walletapiversion"`
}
type simpleResponse struct {
Success bool `json:"success"`
}
type unlockResponse struct {
Success bool `json:"success"`
UnlockedUntil int64 `json:"unlockeduntil"`
}
type entryResponse struct {
Commit *factom.JSON2Request `json:"commit"`
Reveal *factom.JSON2Request `json:"reveal"`
}
type heightResponse struct {
Height int64 `json:"height"`
}
type identityKeyResponse struct {
Public string `json:"public"`
Secret string `json:"secret,omitempty"`
}
type multiIdentityKeyResponse struct {
Keys []*identityKeyResponse `json:"keys"`
}
type activeIdentityKeysResponse struct {
ChainID string `json:"chainid"`
Height int64 `json:"height"`
Keys []string `json:"keys"`
}
type signDataResponse struct {
PubKey []byte `json:"pubkey"`
Signature []byte `json:"signature"`
}
// Helper structs
type UnmarBody struct {
Jsonrpc string `json:"jsonrps"`
Id int `json:"id"`
Result balanceResponse `json:"result"`
}