-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexplorer.go
90 lines (80 loc) · 2.01 KB
/
explorer.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
package explorer
//SendAddressInput SendAddressInput
type SendAddressInput struct {
Address string
Amount float32
Comment string
CommentTo string
SubtractFeeFromAmount bool
Replaceable bool
ConfTarget int64
EstimateMode string
AvoidReuse bool
}
//SendAddressOutput SendAddressOutput
type SendAddressOutput struct {
TxID string //hex
FeeReason string
}
//QueryOptions QueryOptions
type QueryOptions struct {
MinimumAmount interface{}
MaximumAmount interface{}
MaximumCount interface{}
MinimumSumAmount interface{}
}
//ListUnspentInput ListUnspentInput
type ListUnspentInput struct {
Minconf int64
Maxconf int64
Addresses []string
IncludeUnsafe bool
QueryOptions QueryOptions
}
//ListUuspentOutput ListUuspentOutput
type ListUuspentOutput struct {
TxID string //hex
Vout float64
Address string
Label string
ScriptPubKey string
Amount float64
Confirmations int32
RedeemScript string //hex
WitnessScript string
Spendable bool
Solvable bool
Reused bool
Desc string
Safe bool
}
//RawTxInputs RawTxInputs
type RawTxInputs struct {
TxID string //hex
Vout float64
Sequence int32
}
//RawTxOutputs RawTxOutputs
type RawTxOutputs struct {
AddressAmount map[string]interface{}
Data string //hex
}
//CreateRawTxInput CreateRawTxInput
type CreateRawTxInput struct {
Inputs RawTxInputs
Outputs RawTxOutputs
Locktime int32
Replaceable bool
}
//Explorer Explorer
type Explorer interface {
GetNewAddress(label string, atype string) string
SendToAddress(inp SendAddressInput) *SendAddressOutput
ListUnspent(inp *ListUnspentInput) *[]ListUuspentOutput
CreateRawTransaction(inp *CreateRawTxInput) string //hex
//DecodeRawTransaction()
//SignRawTransactionWithKey()
//SignRawTransactionWithWallet()
//ValidateAddress()
}
//GO111MODULE=on go mod init github.com/Ulbora/BitcoinCoreExplorer