forked from toorop/go-bitcoind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.go
79 lines (71 loc) · 2.37 KB
/
cmd.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
// @Time : 2017/10/17 下午11:27
// @Author :
// @Site :
// @File : cmd.go
// @Software: Gogland
package bitcoind
// NewCreateMultisigCmd returns a new instance which can be used to issue a
// createmultisig JSON-RPC command.
func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd {
return &CreateMultisigCmd{
NRequired: nRequired,
Keys: keys,
}
}
// NewAddMultisigAddressCmd returns a new instance which can be used to issue a
// addmultisigaddress JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewAddMultisigAddressCmd(nRequired int, keys []string, account *string) *AddMultisigAddressCmd {
return &AddMultisigAddressCmd{
NRequired: nRequired,
Keys: keys,
Account: account,
}
}
// NewSignRawTransactionCmd returns a new instance which can be used to issue a
// signrawtransaction JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewSignRawTransactionCmd(hexEncodedTx string, inputs *[]RawTxInput, privKeys *[]string, flags *string) *SignRawTransactionCmd {
return &SignRawTransactionCmd{
RawTx: hexEncodedTx,
Inputs: inputs,
PrivKeys: privKeys,
Flags: flags,
}
}
// NewSendRawTransactionCmd returns a new instance which can be used to issue a
// sendrawtransaction JSON-RPC command.
//
// The parameters which are pointers indicate they are optional. Passing nil
// for optional parameters will use the default value.
func NewSendRawTransactionCmd(hexTx string, allowHighFees *bool) *SendRawTransactionCmd {
return &SendRawTransactionCmd{
HexTx: hexTx,
AllowHighFees: allowHighFees,
}
}
// NewCreateRawTransactionCmd returns a new instance which can be used to issue
// a createrawtransaction JSON-RPC command.
//
// Amounts are in BTC.
func NewCreateRawTransactionCmd(inputs []TransactionInput, amounts map[string]float64,
lockTime *int64) *CreateRawTransactionCmd {
return &CreateRawTransactionCmd{
Inputs: inputs,
Amounts: amounts,
LockTime: lockTime,
}
}
// LMC.
func NewCreateSendFromAddressCmd(fromAddress string, amounts map[string]float64,
fee float64) *CreateSendFromAddressCmd {
return &CreateSendFromAddressCmd{
FromAddress: fromAddress,
Amounts: amounts,
Fee: fee,
}
}