forked from FactomProject/factom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wsapistructs.go
99 lines (76 loc) · 2.06 KB
/
wsapistructs.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
// Copyright 2016 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package factom
import "fmt"
// requests
type heightRequest struct {
Height int64 `json:"height"`
}
type ackRequest struct {
Hash string `json:"hash,omitempty"`
ChainID string `json:"chainid,omitempty"`
FullTransaction string `json:"fulltransaction,omitempty"`
}
type addressRequest struct {
Address string `json:"address"`
}
type passphraseRequest struct {
Password string `json:"passphrase"`
Timeout int64 `json:"timeout"`
}
type unlockResponse struct {
Success bool `json:"success"`
UnlockedUntil int64 `json:"unlockeduntil"`
}
type chainIDRequest struct {
ChainID string `json:"chainid"`
}
type entryRequest struct {
Entry string `json:"entry"`
}
type hashRequest struct {
Hash string `json:"hash"`
}
type HeightsResponse struct {
DirectoryBlockHeight int64 `json:"directoryblockheight"`
LeaderHeight int64 `json:"leaderheight"`
EntryBlockHeight int64 `json:"entryblockheight"`
EntryHeight int64 `json:"entryheight"`
}
func (d *HeightsResponse) String() string {
var s string
s += fmt.Sprintln("DirectoryBlockHeight:", d.DirectoryBlockHeight)
s += fmt.Sprintln("LeaderHeight:", d.LeaderHeight)
s += fmt.Sprintln("EntryBlockHeight:", d.EntryBlockHeight)
s += fmt.Sprintln("EntryHeight:", d.EntryHeight)
return s
}
type importRequest struct {
Addresses []secretRequest `json:"addresses"`
}
type importKoinifyRequest struct {
Words string `json:"words"`
}
type keyMRRequest struct {
KeyMR string `json:"keymr"`
}
type messageRequest struct {
Message string `json:"message"`
}
type secretRequest struct {
Secret string `json:"secret"`
}
type transactionRequest struct {
Name string `json:"tx-name"`
Force bool `json:"force"`
}
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"`
}