-
Notifications
You must be signed in to change notification settings - Fork 4
/
message.go
69 lines (50 loc) · 1.44 KB
/
message.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
package gostratum
import ("encoding/json")
type Request struct{
Method string `json:"method"`
Params []string `json:"params"`
ID uint64 `json:"id"`
}
/*method, params is used in notifications*/
type Response struct{
ID uint64 `json:"id"`
Result *json.RawMessage `json:"result"`
Error error `json:"error,string"`
Method string `json:"method"`
Params *json.RawMessage `json:"params"`
}
type BlockHeader struct{
Nonce uint64 `json:"nonce"`
PrevHash string `json:"prev_block_hash"`
Timestamp uint64 `json:"timestamp"`
Merkle string `json:"merkle_root"`
Height uint64 `json:"block_height"`
UTXO string `json:"utxo_root"`
Version uint64 `json:"version"`
Bits uint64 `json:"bits"`
}
type Peer struct{
IP string
URL string
Version string
}
type AddressTransaction struct{
TxHash string `json:"tx_hash"`
Height uint64 `json:"height"`
}
type Balance struct{
Confirmed int64 `json:"confirmed"`
Unconfirmed int64 `json:"unconfirmed"`
}
//type AddressProof struct{
// Address string
// Proof string
//}
type UnspentTransaction struct{
Hash string `json:"tx_hash"`
Pos uint64 `json:"tx_pos"`
Value uint64 `json:"value"`
Height uint64 `json:"height"`
}
type Transaction struct{
}