add listreceivedbyaccount and listreceivedbyaddress to btcctl
This commit is contained in:
parent
1a64f33fca
commit
9c2abd1fa1
1 changed files with 26 additions and 0 deletions
|
@ -80,6 +80,8 @@ var commandHandlers = map[string]*handlerData{
|
||||||
"keypoolrefill": &handlerData{0, 1, displayGeneric, []conversionHandler{toInt}, makeKeyPoolRefill, "[newsize]"},
|
"keypoolrefill": &handlerData{0, 1, displayGeneric, []conversionHandler{toInt}, makeKeyPoolRefill, "[newsize]"},
|
||||||
"listaccounts": &handlerData{0, 1, displayJSONDump, []conversionHandler{toInt}, makeListAccounts, "[minconf=1]"},
|
"listaccounts": &handlerData{0, 1, displayJSONDump, []conversionHandler{toInt}, makeListAccounts, "[minconf=1]"},
|
||||||
"listaddressgroupings": &handlerData{0, 0, displayJSONDump, nil, makeListAddressGroupings, ""},
|
"listaddressgroupings": &handlerData{0, 0, displayJSONDump, nil, makeListAddressGroupings, ""},
|
||||||
|
"listreceivedbyaccount": &handlerData{0, 2, displayJSONDump, []conversionHandler{toInt, toBool}, makeListReceivedByAccount, "[minconf] [includeempty]"},
|
||||||
|
"listreceivedbyaddress": &handlerData{0, 2, displayJSONDump, []conversionHandler{toInt, toBool}, makeListReceivedByAddress, "[minconf] [includeempty]"},
|
||||||
"listlockunspent": &handlerData{0, 0, displayJSONDump, nil, makeListLockUnspent, ""},
|
"listlockunspent": &handlerData{0, 0, displayJSONDump, nil, makeListLockUnspent, ""},
|
||||||
"listsinceblock": &handlerData{0, 2, displayJSONDump, []conversionHandler{nil, toInt}, makeListSinceBlock, "[blockhash] [minconf=10]"},
|
"listsinceblock": &handlerData{0, 2, displayJSONDump, []conversionHandler{nil, toInt}, makeListSinceBlock, "[blockhash] [minconf=10]"},
|
||||||
"listtransactions": &handlerData{0, 3, displayJSONDump, []conversionHandler{nil, toInt, toInt}, makeListTransactions, "[account] [count=10] [from=0]"},
|
"listtransactions": &handlerData{0, 3, displayJSONDump, []conversionHandler{nil, toInt, toInt}, makeListTransactions, "[account] [count=10] [from=0]"},
|
||||||
|
@ -494,6 +496,30 @@ func makeListAddressGroupings(args []interface{}) (btcjson.Cmd, error) {
|
||||||
return btcjson.NewListAddressGroupingsCmd("btcctl")
|
return btcjson.NewListAddressGroupingsCmd("btcctl")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// makeListReceivedByAccount generates the cmd structure for listreceivedbyaccount commands.
|
||||||
|
func makeListReceivedByAccount(args []interface{}) (btcjson.Cmd, error) {
|
||||||
|
var optargs = make([]interface{}, 0, 2)
|
||||||
|
if len(args) > 0 {
|
||||||
|
optargs = append(optargs, args[0].(int))
|
||||||
|
}
|
||||||
|
if len(args) > 1 {
|
||||||
|
optargs = append(optargs, args[1].(bool))
|
||||||
|
}
|
||||||
|
return btcjson.NewListReceivedByAccountCmd("btcctl", optargs...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// makeListReceivedByAddress generates the cmd structure for listreceivedbyaddress commands.
|
||||||
|
func makeListReceivedByAddress(args []interface{}) (btcjson.Cmd, error) {
|
||||||
|
var optargs = make([]interface{}, 0, 2)
|
||||||
|
if len(args) > 0 {
|
||||||
|
optargs = append(optargs, args[0].(int))
|
||||||
|
}
|
||||||
|
if len(args) > 1 {
|
||||||
|
optargs = append(optargs, args[1].(bool))
|
||||||
|
}
|
||||||
|
return btcjson.NewListReceivedByAddressCmd("btcctl", optargs...)
|
||||||
|
}
|
||||||
|
|
||||||
// makeListLockUnspent generates the cmd structure for listlockunspent commands.
|
// makeListLockUnspent generates the cmd structure for listlockunspent commands.
|
||||||
func makeListLockUnspent(args []interface{}) (btcjson.Cmd, error) {
|
func makeListLockUnspent(args []interface{}) (btcjson.Cmd, error) {
|
||||||
return btcjson.NewListLockUnspentCmd("btcctl")
|
return btcjson.NewListLockUnspentCmd("btcctl")
|
||||||
|
|
Loading…
Add table
Reference in a new issue