-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtype.go
74 lines (66 loc) · 1.93 KB
/
type.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
package btcrpc
// Block ...
type Block struct {
Hash string `json:"hash"`
Version int32 `json:"version"`
Txs []string `json:"txs"`
Time int32 `json:"time"`
Size int32 `json:"size"`
Nonce int32 `json:"nonce"`
Weight int32 `json:"weight"`
VersionHex string `json:"versionHex"`
Difficulty int32 `json:"difficulty"`
Mediantime int32 `json:"mediantime"`
Chainwork string `json:"chainwork"`
Strippedsize int32 `json:"strippedsize"`
Merkleroot string `json:"merkleroot"`
Bits string `json:"bits"`
NextBlockhash string `json:"nextBlockhash"`
Confirmations int32 `json:"confirmations"`
Height int32 `json:"height"`
}
// Transaction ...
type Transaction struct {
Txid string `json:"txid"`
Hash string `json:"hash"`
Version int32 `json:"id"`
Size int32 `json:"size"`
Vsize int32 `json:"vsize"`
Locktime int32 `json:"locktime"`
Vins Vin
Vouts []Vout
}
// Vin ...
type Vin map[int]interface{}
// Vout ...
type Vout struct {
Value float32 `json:"value"`
N int32 `json:"n"`
ScriptPubKey ScriptPubKey
}
// ScriptPubKey ...
type ScriptPubKey struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
ReqSigs int32 `json:"reqSigs"`
Type string `json:"type"`
Addresses []string `json:"addresses"`
}
// VinTransaction is a struct of Vin(inputs) with normal transaction.
type VinTransaction struct {
Txid string `json:"txid"`
Vout int32 `json:"vout"`
ScriptSig ScriptSig
TxinWitness []string `json:"txinWitness"`
Sequence int64 `json:"Sequence"`
}
// VinCoinbaseTransaction is a struct of Vins(inputs) with mining.
type VinCoinbaseTransaction struct {
Coinbase string `json:"coinbase"`
Sequence int64 `json:"sequence"`
}
// ScriptSig ...
type ScriptSig struct {
Asm string `json:"asm"`
Hex string `json:"hex"`
}