-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
108 lines (89 loc) · 2.5 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
package gonvs
import (
rpcclient "github.com/bitlum/go-bitcoind-rpc/rpcclient"
)
// Client - Emercoin NVS client
type Client struct {
RPC *rpcclient.Client
}
// CreateClientTask - new Client data
type CreateClientTask struct {
Host string `json:"host"` // default: 127.0.0.1
RPCUser string `json:"user"`
RPCPassword string `json:"password"`
RPCPort string `json:"port"` // default: 6662
UseSSL bool `json:"useSSL"`
}
// ValueType - NVS value type
type ValueType string
const (
// ValueTypeHex - hex value
ValueTypeHex string = "hex"
// ValueTypeBase64 - base64 value
ValueTypeBase64 string = "base64"
// ValueTypePlain - plain (unicode) string. by default
ValueTypePlain string = ""
)
// WriteEntryTask - new blockchain NVS entry data
type WriteEntryTask struct {
// required
Name string `json:"name"`
Value []byte `json:"value"`
Days int `json:"days"`
// optional
ToAddress string `json:"toAddress"`
ValueType ValueType `json:"type"`
}
// GetEntrysByAddressTask - get NVS entrys by given address, data
type GetEntrysByAddressTask struct {
// required
Address string `json:"address"`
// optional
MaxValueLength int `json:"maxValueLength"` // bytes
ValueType ValueType `json:"type"`
}
// Entry - NVS Entry
type Entry struct {
Name string `json:"name"`
Value string `json:"value"`
TXID string `json:"txid"`
Address string `json:"address"`
ExpiresIn int `json:"expiresIn"`
ExpiresAt int `json:"expiresAt"`
Time int64 `json:"time"`
}
// GetEntryTask - get NVS entry task
type GetEntryTask struct {
// required
Name string `json:"name"`
// optional
ValueType ValueType `json:"type"`
Filepath string `json:"filepath"`
}
// GetEntryHistoryTask - get NVS entry history
type GetEntryHistoryTask struct {
// required
Name string `json:"name"`
// optional
LoadFullHistory bool `json:"fullhistory"`
ValueType ValueType `json:"type"`
}
type rawTXInput struct {
TransactionID string `json:"txid"`
VOut int `json:"vout"`
}
type unspentData struct {
TransactionID string `json:"txid"`
VOut int `json:"vout"`
Address string `json:"address"`
Account string `json:"account"`
ScriptPubKey string `json:"scriptPubKey"`
Amount float64 `json:"amount"`
Confirmations int `json:"confirmations"`
Spendable bool `json:"spendable"`
Solvable bool `json:"solvable"`
}
type signRawTXResponse struct {
Hex string `json:"hex"`
Complete bool `json:"complete"`
}