diff --git a/btcjson/walletsvrcmds.go b/btcjson/walletsvrcmds.go index 2b977404..f340714b 100644 --- a/btcjson/walletsvrcmds.go +++ b/btcjson/walletsvrcmds.go @@ -237,6 +237,15 @@ func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransaction } } +// GetWalletInfoCmd defines the getwalletinfo JSON-RPC command. +type GetWalletInfoCmd struct{} + +// NewGetWalletInfoCmd returns a new instance which can be used to issue a +// getwalletinfo JSON-RPC command. +func NewGetWalletInfoCmd() *GetWalletInfoCmd { + return &GetWalletInfoCmd{} +} + // ImportPrivKeyCmd defines the importprivkey JSON-RPC command. type ImportPrivKeyCmd struct { PrivKey string @@ -650,6 +659,7 @@ func init() { MustRegisterCmd("getreceivedbyaccount", (*GetReceivedByAccountCmd)(nil), flags) MustRegisterCmd("getreceivedbyaddress", (*GetReceivedByAddressCmd)(nil), flags) MustRegisterCmd("gettransaction", (*GetTransactionCmd)(nil), flags) + MustRegisterCmd("getwalletinfo", (*GetWalletInfoCmd)(nil), flags) MustRegisterCmd("importprivkey", (*ImportPrivKeyCmd)(nil), flags) MustRegisterCmd("keypoolrefill", (*KeyPoolRefillCmd)(nil), flags) MustRegisterCmd("listaccounts", (*ListAccountsCmd)(nil), flags) diff --git a/btcjson/walletsvrcmds_test.go b/btcjson/walletsvrcmds_test.go index ed551da8..d4755cc1 100644 --- a/btcjson/walletsvrcmds_test.go +++ b/btcjson/walletsvrcmds_test.go @@ -345,6 +345,17 @@ func TestWalletSvrCmds(t *testing.T) { IncludeWatchOnly: btcjson.Bool(true), }, }, + { + name: "getwalletinfo", + newCmd: func() (interface{}, error) { + return btcjson.NewCmd("getwalletinfo") + }, + staticCmd: func() interface{} { + return btcjson.NewGetWalletInfoCmd() + }, + marshalled: `{"jsonrpc":"1.0","method":"getwalletinfo","params":[],"id":1}`, + unmarshalled: &btcjson.GetWalletInfoCmd{}, + }, { name: "importprivkey", newCmd: func() (interface{}, error) {