-
Notifications
You must be signed in to change notification settings - Fork 0
/
responses.go
101 lines (97 loc) · 3.13 KB
/
responses.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
package rpcclient
import "encoding/json"
// Response ...
type Response struct {
ID int32 `json:"id"`
Result json.RawMessage `json:"result"`
Error struct {
Code int32 `json:"code"`
Message string `json:"message"`
} `json:"error"`
}
// BlockVerbosity ...
type BlockVerbosity struct {
Hash string `json:"hash"`
Confirmations int64 `json:"confirmations"`
StrippedSize int64 `json:"strippedsize"`
Size int64 `json:"size"`
Weight int64 `json:"weight"`
Height int64 `json:"height"`
Version int `json:"version"`
VersionHex string `json:"versionHex"`
MerkleRoot string `json:"merkleroot"`
Tx []struct {
TxID string `json:"txid"`
Hash string `json:"hash"`
Version int `json:"version"`
Size int64 `json:"size"`
VSize int64 `json:"vsize"`
LockTime int64 `json:"locktime"`
Vin []struct {
Coinbase string `json:"coinbase"`
TxID string `json:"txid"`
Vout int `json:"vout"`
ScriptSig struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
} `json:"scriptSig"`
Sequence int64 `json:"sequence"`
} `json:"vin"`
Vout []struct {
Value float64 `json:"value"`
N int `json:"n"`
ScriptPubKey struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
RegSigs int `json:"reqSigs"`
Type string `json:"type"`
Addresses []string `json:"addresses"`
} `json:"scriptPubKey"`
} `json:"vout"`
Hex string `json:"hex"`
} `json:"tx"`
Time int64 `json:"time"`
MedianTime int64 `json:"mediantime"`
Nonce uint64 `json:"nonce"`
Bits string `json:"bits"`
Difficulty float64 `json:"difficulty"`
ChainWork string `json:"chainwork"`
NTx int `json:"nTx"`
PreviousBlockHash string `json:"previousblockhash"`
NextBlockHash string `json:"nextblockhash"`
}
// BlockchainInfo ...
type BlockchainInfo struct {
Chain string `json:"chain"`
Blocks uint64 `json:"blocks"`
Headers uint64 `json:"headers"`
BestBlockHash string `json:"bestblockhash"`
Difficulty float64 `json:"difficulty"`
MedianTime int64 `json:"mediantime"`
VerificationProgress float64 `json:"verificationprogress"`
InitialBlockDownload bool `json:"initialblockdownload"`
ChainWork string `json:"chainwork"`
SizeOnDisk uint64 `json:"size_on_disk"`
Pruned bool `json:"pruned"`
SoftForks []struct {
ID string `json:"id"`
Version int `json:"version"`
Reject struct {
Status bool `json:"status"`
} `json:"reject"`
} `json:"softforks"`
BIP9SoftForks struct {
CSV struct {
Status string `json:"string"`
StartTime int64 `json:"startTime"`
Timeout int64 `json:"timeout"`
Since int64 `json:"since"`
} `json:"csv"`
Segwit struct {
Status string `json:"string"`
StartTime int64 `json:"startTime"`
Timeout int64 `json:"timeout"`
Since int64 `json:"since"`
} `json:"segwit"`
} `json:"bip9_softforks"`
}