1// Copyright (c) 2014 The btcsuite developers
2// Use of this source code is governed by an ISC
3// license that can be found in the LICENSE file.
4
5// NOTE: This file is intended to house the RPC commands that are supported by
6// a wallet server.
7
8package btcjson
9
10// AddMultisigAddressCmd defines the addmutisigaddress JSON-RPC command.
11type AddMultisigAddressCmd struct {
12	NRequired int
13	Keys      []string
14	Account   *string
15}
16
17// NewAddMultisigAddressCmd returns a new instance which can be used to issue a
18// addmultisigaddress JSON-RPC command.
19//
20// The parameters which are pointers indicate they are optional.  Passing nil
21// for optional parameters will use the default value.
22func NewAddMultisigAddressCmd(nRequired int, keys []string, account *string) *AddMultisigAddressCmd {
23	return &AddMultisigAddressCmd{
24		NRequired: nRequired,
25		Keys:      keys,
26		Account:   account,
27	}
28}
29
30// AddWitnessAddressCmd defines the addwitnessaddress JSON-RPC command.
31type AddWitnessAddressCmd struct {
32	Address string
33}
34
35// NewAddWitnessAddressCmd returns a new instance which can be used to issue a
36// addwitnessaddress JSON-RPC command.
37func NewAddWitnessAddressCmd(address string) *AddWitnessAddressCmd {
38	return &AddWitnessAddressCmd{
39		Address: address,
40	}
41}
42
43// CreateMultisigCmd defines the createmultisig JSON-RPC command.
44type CreateMultisigCmd struct {
45	NRequired int
46	Keys      []string
47}
48
49// NewCreateMultisigCmd returns a new instance which can be used to issue a
50// createmultisig JSON-RPC command.
51func NewCreateMultisigCmd(nRequired int, keys []string) *CreateMultisigCmd {
52	return &CreateMultisigCmd{
53		NRequired: nRequired,
54		Keys:      keys,
55	}
56}
57
58// DumpPrivKeyCmd defines the dumpprivkey JSON-RPC command.
59type DumpPrivKeyCmd struct {
60	Address string
61}
62
63// NewDumpPrivKeyCmd returns a new instance which can be used to issue a
64// dumpprivkey JSON-RPC command.
65func NewDumpPrivKeyCmd(address string) *DumpPrivKeyCmd {
66	return &DumpPrivKeyCmd{
67		Address: address,
68	}
69}
70
71// EncryptWalletCmd defines the encryptwallet JSON-RPC command.
72type EncryptWalletCmd struct {
73	Passphrase string
74}
75
76// NewEncryptWalletCmd returns a new instance which can be used to issue a
77// encryptwallet JSON-RPC command.
78func NewEncryptWalletCmd(passphrase string) *EncryptWalletCmd {
79	return &EncryptWalletCmd{
80		Passphrase: passphrase,
81	}
82}
83
84// EstimateSmartFeeMode defines the different fee estimation modes available
85// for the estimatesmartfee JSON-RPC command.
86type EstimateSmartFeeMode string
87
88var (
89	EstimateModeUnset        EstimateSmartFeeMode = "UNSET"
90	EstimateModeEconomical   EstimateSmartFeeMode = "ECONOMICAL"
91	EstimateModeConservative EstimateSmartFeeMode = "CONSERVATIVE"
92)
93
94// EstimateSmartFeeCmd defines the estimatesmartfee JSON-RPC command.
95type EstimateSmartFeeCmd struct {
96	ConfTarget   int64
97	EstimateMode *EstimateSmartFeeMode `jsonrpcdefault:"\"CONSERVATIVE\""`
98}
99
100// NewEstimateSmartFeeCmd returns a new instance which can be used to issue a
101// estimatesmartfee JSON-RPC command.
102func NewEstimateSmartFeeCmd(confTarget int64, mode *EstimateSmartFeeMode) *EstimateSmartFeeCmd {
103	return &EstimateSmartFeeCmd{
104		ConfTarget: confTarget, EstimateMode: mode,
105	}
106}
107
108// EstimateFeeCmd defines the estimatefee JSON-RPC command.
109type EstimateFeeCmd struct {
110	NumBlocks int64
111}
112
113// NewEstimateFeeCmd returns a new instance which can be used to issue a
114// estimatefee JSON-RPC command.
115func NewEstimateFeeCmd(numBlocks int64) *EstimateFeeCmd {
116	return &EstimateFeeCmd{
117		NumBlocks: numBlocks,
118	}
119}
120
121// EstimatePriorityCmd defines the estimatepriority JSON-RPC command.
122type EstimatePriorityCmd struct {
123	NumBlocks int64
124}
125
126// NewEstimatePriorityCmd returns a new instance which can be used to issue a
127// estimatepriority JSON-RPC command.
128func NewEstimatePriorityCmd(numBlocks int64) *EstimatePriorityCmd {
129	return &EstimatePriorityCmd{
130		NumBlocks: numBlocks,
131	}
132}
133
134// GetAccountCmd defines the getaccount JSON-RPC command.
135type GetAccountCmd struct {
136	Address string
137}
138
139// NewGetAccountCmd returns a new instance which can be used to issue a
140// getaccount JSON-RPC command.
141func NewGetAccountCmd(address string) *GetAccountCmd {
142	return &GetAccountCmd{
143		Address: address,
144	}
145}
146
147// GetAccountAddressCmd defines the getaccountaddress JSON-RPC command.
148type GetAccountAddressCmd struct {
149	Account string
150}
151
152// NewGetAccountAddressCmd returns a new instance which can be used to issue a
153// getaccountaddress JSON-RPC command.
154func NewGetAccountAddressCmd(account string) *GetAccountAddressCmd {
155	return &GetAccountAddressCmd{
156		Account: account,
157	}
158}
159
160// GetAddressesByAccountCmd defines the getaddressesbyaccount JSON-RPC command.
161type GetAddressesByAccountCmd struct {
162	Account string
163}
164
165// NewGetAddressesByAccountCmd returns a new instance which can be used to issue
166// a getaddressesbyaccount JSON-RPC command.
167func NewGetAddressesByAccountCmd(account string) *GetAddressesByAccountCmd {
168	return &GetAddressesByAccountCmd{
169		Account: account,
170	}
171}
172
173// GetBalanceCmd defines the getbalance JSON-RPC command.
174type GetBalanceCmd struct {
175	Account *string
176	MinConf *int `jsonrpcdefault:"1"`
177}
178
179// NewGetBalanceCmd returns a new instance which can be used to issue a
180// getbalance JSON-RPC command.
181//
182// The parameters which are pointers indicate they are optional.  Passing nil
183// for optional parameters will use the default value.
184func NewGetBalanceCmd(account *string, minConf *int) *GetBalanceCmd {
185	return &GetBalanceCmd{
186		Account: account,
187		MinConf: minConf,
188	}
189}
190
191// GetNewAddressCmd defines the getnewaddress JSON-RPC command.
192type GetNewAddressCmd struct {
193	Account *string
194}
195
196// NewGetNewAddressCmd returns a new instance which can be used to issue a
197// getnewaddress JSON-RPC command.
198//
199// The parameters which are pointers indicate they are optional.  Passing nil
200// for optional parameters will use the default value.
201func NewGetNewAddressCmd(account *string) *GetNewAddressCmd {
202	return &GetNewAddressCmd{
203		Account: account,
204	}
205}
206
207// GetRawChangeAddressCmd defines the getrawchangeaddress JSON-RPC command.
208type GetRawChangeAddressCmd struct {
209	Account *string
210}
211
212// NewGetRawChangeAddressCmd returns a new instance which can be used to issue a
213// getrawchangeaddress JSON-RPC command.
214//
215// The parameters which are pointers indicate they are optional.  Passing nil
216// for optional parameters will use the default value.
217func NewGetRawChangeAddressCmd(account *string) *GetRawChangeAddressCmd {
218	return &GetRawChangeAddressCmd{
219		Account: account,
220	}
221}
222
223// GetReceivedByAccountCmd defines the getreceivedbyaccount JSON-RPC command.
224type GetReceivedByAccountCmd struct {
225	Account string
226	MinConf *int `jsonrpcdefault:"1"`
227}
228
229// NewGetReceivedByAccountCmd returns a new instance which can be used to issue
230// a getreceivedbyaccount JSON-RPC command.
231//
232// The parameters which are pointers indicate they are optional.  Passing nil
233// for optional parameters will use the default value.
234func NewGetReceivedByAccountCmd(account string, minConf *int) *GetReceivedByAccountCmd {
235	return &GetReceivedByAccountCmd{
236		Account: account,
237		MinConf: minConf,
238	}
239}
240
241// GetReceivedByAddressCmd defines the getreceivedbyaddress JSON-RPC command.
242type GetReceivedByAddressCmd struct {
243	Address string
244	MinConf *int `jsonrpcdefault:"1"`
245}
246
247// NewGetReceivedByAddressCmd returns a new instance which can be used to issue
248// a getreceivedbyaddress JSON-RPC command.
249//
250// The parameters which are pointers indicate they are optional.  Passing nil
251// for optional parameters will use the default value.
252func NewGetReceivedByAddressCmd(address string, minConf *int) *GetReceivedByAddressCmd {
253	return &GetReceivedByAddressCmd{
254		Address: address,
255		MinConf: minConf,
256	}
257}
258
259// GetTransactionCmd defines the gettransaction JSON-RPC command.
260type GetTransactionCmd struct {
261	Txid             string
262	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
263}
264
265// NewGetTransactionCmd returns a new instance which can be used to issue a
266// gettransaction JSON-RPC command.
267//
268// The parameters which are pointers indicate they are optional.  Passing nil
269// for optional parameters will use the default value.
270func NewGetTransactionCmd(txHash string, includeWatchOnly *bool) *GetTransactionCmd {
271	return &GetTransactionCmd{
272		Txid:             txHash,
273		IncludeWatchOnly: includeWatchOnly,
274	}
275}
276
277// GetWalletInfoCmd defines the getwalletinfo JSON-RPC command.
278type GetWalletInfoCmd struct{}
279
280// NewGetWalletInfoCmd returns a new instance which can be used to issue a
281// getwalletinfo JSON-RPC command.
282func NewGetWalletInfoCmd() *GetWalletInfoCmd {
283	return &GetWalletInfoCmd{}
284}
285
286// ImportPrivKeyCmd defines the importprivkey JSON-RPC command.
287type ImportPrivKeyCmd struct {
288	PrivKey string
289	Label   *string
290	Rescan  *bool `jsonrpcdefault:"true"`
291}
292
293// NewImportPrivKeyCmd returns a new instance which can be used to issue a
294// importprivkey JSON-RPC command.
295//
296// The parameters which are pointers indicate they are optional.  Passing nil
297// for optional parameters will use the default value.
298func NewImportPrivKeyCmd(privKey string, label *string, rescan *bool) *ImportPrivKeyCmd {
299	return &ImportPrivKeyCmd{
300		PrivKey: privKey,
301		Label:   label,
302		Rescan:  rescan,
303	}
304}
305
306// KeyPoolRefillCmd defines the keypoolrefill JSON-RPC command.
307type KeyPoolRefillCmd struct {
308	NewSize *uint `jsonrpcdefault:"100"`
309}
310
311// NewKeyPoolRefillCmd returns a new instance which can be used to issue a
312// keypoolrefill JSON-RPC command.
313//
314// The parameters which are pointers indicate they are optional.  Passing nil
315// for optional parameters will use the default value.
316func NewKeyPoolRefillCmd(newSize *uint) *KeyPoolRefillCmd {
317	return &KeyPoolRefillCmd{
318		NewSize: newSize,
319	}
320}
321
322// ListAccountsCmd defines the listaccounts JSON-RPC command.
323type ListAccountsCmd struct {
324	MinConf *int `jsonrpcdefault:"1"`
325}
326
327// NewListAccountsCmd returns a new instance which can be used to issue a
328// listaccounts JSON-RPC command.
329//
330// The parameters which are pointers indicate they are optional.  Passing nil
331// for optional parameters will use the default value.
332func NewListAccountsCmd(minConf *int) *ListAccountsCmd {
333	return &ListAccountsCmd{
334		MinConf: minConf,
335	}
336}
337
338// ListAddressGroupingsCmd defines the listaddressgroupings JSON-RPC command.
339type ListAddressGroupingsCmd struct{}
340
341// NewListAddressGroupingsCmd returns a new instance which can be used to issue
342// a listaddressgroupoings JSON-RPC command.
343func NewListAddressGroupingsCmd() *ListAddressGroupingsCmd {
344	return &ListAddressGroupingsCmd{}
345}
346
347// ListLockUnspentCmd defines the listlockunspent JSON-RPC command.
348type ListLockUnspentCmd struct{}
349
350// NewListLockUnspentCmd returns a new instance which can be used to issue a
351// listlockunspent JSON-RPC command.
352func NewListLockUnspentCmd() *ListLockUnspentCmd {
353	return &ListLockUnspentCmd{}
354}
355
356// ListReceivedByAccountCmd defines the listreceivedbyaccount JSON-RPC command.
357type ListReceivedByAccountCmd struct {
358	MinConf          *int  `jsonrpcdefault:"1"`
359	IncludeEmpty     *bool `jsonrpcdefault:"false"`
360	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
361}
362
363// NewListReceivedByAccountCmd returns a new instance which can be used to issue
364// a listreceivedbyaccount JSON-RPC command.
365//
366// The parameters which are pointers indicate they are optional.  Passing nil
367// for optional parameters will use the default value.
368func NewListReceivedByAccountCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAccountCmd {
369	return &ListReceivedByAccountCmd{
370		MinConf:          minConf,
371		IncludeEmpty:     includeEmpty,
372		IncludeWatchOnly: includeWatchOnly,
373	}
374}
375
376// ListReceivedByAddressCmd defines the listreceivedbyaddress JSON-RPC command.
377type ListReceivedByAddressCmd struct {
378	MinConf          *int  `jsonrpcdefault:"1"`
379	IncludeEmpty     *bool `jsonrpcdefault:"false"`
380	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
381}
382
383// NewListReceivedByAddressCmd returns a new instance which can be used to issue
384// a listreceivedbyaddress JSON-RPC command.
385//
386// The parameters which are pointers indicate they are optional.  Passing nil
387// for optional parameters will use the default value.
388func NewListReceivedByAddressCmd(minConf *int, includeEmpty, includeWatchOnly *bool) *ListReceivedByAddressCmd {
389	return &ListReceivedByAddressCmd{
390		MinConf:          minConf,
391		IncludeEmpty:     includeEmpty,
392		IncludeWatchOnly: includeWatchOnly,
393	}
394}
395
396// ListSinceBlockCmd defines the listsinceblock JSON-RPC command.
397type ListSinceBlockCmd struct {
398	BlockHash           *string
399	TargetConfirmations *int  `jsonrpcdefault:"1"`
400	IncludeWatchOnly    *bool `jsonrpcdefault:"false"`
401}
402
403// NewListSinceBlockCmd returns a new instance which can be used to issue a
404// listsinceblock JSON-RPC command.
405//
406// The parameters which are pointers indicate they are optional.  Passing nil
407// for optional parameters will use the default value.
408func NewListSinceBlockCmd(blockHash *string, targetConfirms *int, includeWatchOnly *bool) *ListSinceBlockCmd {
409	return &ListSinceBlockCmd{
410		BlockHash:           blockHash,
411		TargetConfirmations: targetConfirms,
412		IncludeWatchOnly:    includeWatchOnly,
413	}
414}
415
416// ListTransactionsCmd defines the listtransactions JSON-RPC command.
417type ListTransactionsCmd struct {
418	Account          *string
419	Count            *int  `jsonrpcdefault:"10"`
420	From             *int  `jsonrpcdefault:"0"`
421	IncludeWatchOnly *bool `jsonrpcdefault:"false"`
422}
423
424// NewListTransactionsCmd returns a new instance which can be used to issue a
425// listtransactions JSON-RPC command.
426//
427// The parameters which are pointers indicate they are optional.  Passing nil
428// for optional parameters will use the default value.
429func NewListTransactionsCmd(account *string, count, from *int, includeWatchOnly *bool) *ListTransactionsCmd {
430	return &ListTransactionsCmd{
431		Account:          account,
432		Count:            count,
433		From:             from,
434		IncludeWatchOnly: includeWatchOnly,
435	}
436}
437
438// ListUnspentCmd defines the listunspent JSON-RPC command.
439type ListUnspentCmd struct {
440	MinConf   *int `jsonrpcdefault:"1"`
441	MaxConf   *int `jsonrpcdefault:"9999999"`
442	Addresses *[]string
443}
444
445// NewListUnspentCmd returns a new instance which can be used to issue a
446// listunspent JSON-RPC command.
447//
448// The parameters which are pointers indicate they are optional.  Passing nil
449// for optional parameters will use the default value.
450func NewListUnspentCmd(minConf, maxConf *int, addresses *[]string) *ListUnspentCmd {
451	return &ListUnspentCmd{
452		MinConf:   minConf,
453		MaxConf:   maxConf,
454		Addresses: addresses,
455	}
456}
457
458// LockUnspentCmd defines the lockunspent JSON-RPC command.
459type LockUnspentCmd struct {
460	Unlock       bool
461	Transactions []TransactionInput
462}
463
464// NewLockUnspentCmd returns a new instance which can be used to issue a
465// lockunspent JSON-RPC command.
466func NewLockUnspentCmd(unlock bool, transactions []TransactionInput) *LockUnspentCmd {
467	return &LockUnspentCmd{
468		Unlock:       unlock,
469		Transactions: transactions,
470	}
471}
472
473// MoveCmd defines the move JSON-RPC command.
474type MoveCmd struct {
475	FromAccount string
476	ToAccount   string
477	Amount      float64 // In BTC
478	MinConf     *int    `jsonrpcdefault:"1"`
479	Comment     *string
480}
481
482// NewMoveCmd returns a new instance which can be used to issue a move JSON-RPC
483// command.
484//
485// The parameters which are pointers indicate they are optional.  Passing nil
486// for optional parameters will use the default value.
487func NewMoveCmd(fromAccount, toAccount string, amount float64, minConf *int, comment *string) *MoveCmd {
488	return &MoveCmd{
489		FromAccount: fromAccount,
490		ToAccount:   toAccount,
491		Amount:      amount,
492		MinConf:     minConf,
493		Comment:     comment,
494	}
495}
496
497// SendFromCmd defines the sendfrom JSON-RPC command.
498type SendFromCmd struct {
499	FromAccount string
500	ToAddress   string
501	Amount      float64 // In BTC
502	MinConf     *int    `jsonrpcdefault:"1"`
503	Comment     *string
504	CommentTo   *string
505}
506
507// NewSendFromCmd returns a new instance which can be used to issue a sendfrom
508// JSON-RPC command.
509//
510// The parameters which are pointers indicate they are optional.  Passing nil
511// for optional parameters will use the default value.
512func NewSendFromCmd(fromAccount, toAddress string, amount float64, minConf *int, comment, commentTo *string) *SendFromCmd {
513	return &SendFromCmd{
514		FromAccount: fromAccount,
515		ToAddress:   toAddress,
516		Amount:      amount,
517		MinConf:     minConf,
518		Comment:     comment,
519		CommentTo:   commentTo,
520	}
521}
522
523// SendManyCmd defines the sendmany JSON-RPC command.
524type SendManyCmd struct {
525	FromAccount string
526	Amounts     map[string]float64 `jsonrpcusage:"{\"address\":amount,...}"` // In BTC
527	MinConf     *int               `jsonrpcdefault:"1"`
528	Comment     *string
529}
530
531// NewSendManyCmd returns a new instance which can be used to issue a sendmany
532// JSON-RPC command.
533//
534// The parameters which are pointers indicate they are optional.  Passing nil
535// for optional parameters will use the default value.
536func NewSendManyCmd(fromAccount string, amounts map[string]float64, minConf *int, comment *string) *SendManyCmd {
537	return &SendManyCmd{
538		FromAccount: fromAccount,
539		Amounts:     amounts,
540		MinConf:     minConf,
541		Comment:     comment,
542	}
543}
544
545// SendToAddressCmd defines the sendtoaddress JSON-RPC command.
546type SendToAddressCmd struct {
547	Address   string
548	Amount    float64
549	Comment   *string
550	CommentTo *string
551}
552
553// NewSendToAddressCmd returns a new instance which can be used to issue a
554// sendtoaddress JSON-RPC command.
555//
556// The parameters which are pointers indicate they are optional.  Passing nil
557// for optional parameters will use the default value.
558func NewSendToAddressCmd(address string, amount float64, comment, commentTo *string) *SendToAddressCmd {
559	return &SendToAddressCmd{
560		Address:   address,
561		Amount:    amount,
562		Comment:   comment,
563		CommentTo: commentTo,
564	}
565}
566
567// SetAccountCmd defines the setaccount JSON-RPC command.
568type SetAccountCmd struct {
569	Address string
570	Account string
571}
572
573// NewSetAccountCmd returns a new instance which can be used to issue a
574// setaccount JSON-RPC command.
575func NewSetAccountCmd(address, account string) *SetAccountCmd {
576	return &SetAccountCmd{
577		Address: address,
578		Account: account,
579	}
580}
581
582// SetTxFeeCmd defines the settxfee JSON-RPC command.
583type SetTxFeeCmd struct {
584	Amount float64 // In BTC
585}
586
587// NewSetTxFeeCmd returns a new instance which can be used to issue a settxfee
588// JSON-RPC command.
589func NewSetTxFeeCmd(amount float64) *SetTxFeeCmd {
590	return &SetTxFeeCmd{
591		Amount: amount,
592	}
593}
594
595// SignMessageCmd defines the signmessage JSON-RPC command.
596type SignMessageCmd struct {
597	Address string
598	Message string
599}
600
601// NewSignMessageCmd returns a new instance which can be used to issue a
602// signmessage JSON-RPC command.
603func NewSignMessageCmd(address, message string) *SignMessageCmd {
604	return &SignMessageCmd{
605		Address: address,
606		Message: message,
607	}
608}
609
610// RawTxInput models the data needed for raw transaction input that is used in
611// the SignRawTransactionCmd struct.
612type RawTxInput struct {
613	Txid         string `json:"txid"`
614	Vout         uint32 `json:"vout"`
615	ScriptPubKey string `json:"scriptPubKey"`
616	RedeemScript string `json:"redeemScript"`
617}
618
619// SignRawTransactionCmd defines the signrawtransaction JSON-RPC command.
620type SignRawTransactionCmd struct {
621	RawTx    string
622	Inputs   *[]RawTxInput
623	PrivKeys *[]string
624	Flags    *string `jsonrpcdefault:"\"ALL\""`
625}
626
627// NewSignRawTransactionCmd returns a new instance which can be used to issue a
628// signrawtransaction JSON-RPC command.
629//
630// The parameters which are pointers indicate they are optional.  Passing nil
631// for optional parameters will use the default value.
632func NewSignRawTransactionCmd(hexEncodedTx string, inputs *[]RawTxInput, privKeys *[]string, flags *string) *SignRawTransactionCmd {
633	return &SignRawTransactionCmd{
634		RawTx:    hexEncodedTx,
635		Inputs:   inputs,
636		PrivKeys: privKeys,
637		Flags:    flags,
638	}
639}
640
641// WalletLockCmd defines the walletlock JSON-RPC command.
642type WalletLockCmd struct{}
643
644// NewWalletLockCmd returns a new instance which can be used to issue a
645// walletlock JSON-RPC command.
646func NewWalletLockCmd() *WalletLockCmd {
647	return &WalletLockCmd{}
648}
649
650// WalletPassphraseCmd defines the walletpassphrase JSON-RPC command.
651type WalletPassphraseCmd struct {
652	Passphrase string
653	Timeout    int64
654}
655
656// NewWalletPassphraseCmd returns a new instance which can be used to issue a
657// walletpassphrase JSON-RPC command.
658func NewWalletPassphraseCmd(passphrase string, timeout int64) *WalletPassphraseCmd {
659	return &WalletPassphraseCmd{
660		Passphrase: passphrase,
661		Timeout:    timeout,
662	}
663}
664
665// WalletPassphraseChangeCmd defines the walletpassphrase JSON-RPC command.
666type WalletPassphraseChangeCmd struct {
667	OldPassphrase string
668	NewPassphrase string
669}
670
671// NewWalletPassphraseChangeCmd returns a new instance which can be used to
672// issue a walletpassphrasechange JSON-RPC command.
673func NewWalletPassphraseChangeCmd(oldPassphrase, newPassphrase string) *WalletPassphraseChangeCmd {
674	return &WalletPassphraseChangeCmd{
675		OldPassphrase: oldPassphrase,
676		NewPassphrase: newPassphrase,
677	}
678}
679
680func init() {
681	// The commands in this file are only usable with a wallet server.
682	flags := UFWalletOnly
683
684	MustRegisterCmd("addmultisigaddress", (*AddMultisigAddressCmd)(nil), flags)
685	MustRegisterCmd("addwitnessaddress", (*AddWitnessAddressCmd)(nil), flags)
686	MustRegisterCmd("createmultisig", (*CreateMultisigCmd)(nil), flags)
687	MustRegisterCmd("dumpprivkey", (*DumpPrivKeyCmd)(nil), flags)
688	MustRegisterCmd("encryptwallet", (*EncryptWalletCmd)(nil), flags)
689	MustRegisterCmd("estimatesmartfee", (*EstimateSmartFeeCmd)(nil), flags)
690	MustRegisterCmd("estimatefee", (*EstimateFeeCmd)(nil), flags)
691	MustRegisterCmd("estimatepriority", (*EstimatePriorityCmd)(nil), flags)
692	MustRegisterCmd("getaccount", (*GetAccountCmd)(nil), flags)
693	MustRegisterCmd("getaccountaddress", (*GetAccountAddressCmd)(nil), flags)
694	MustRegisterCmd("getaddressesbyaccount", (*GetAddressesByAccountCmd)(nil), flags)
695	MustRegisterCmd("getbalance", (*GetBalanceCmd)(nil), flags)
696	MustRegisterCmd("getnewaddress", (*GetNewAddressCmd)(nil), flags)
697	MustRegisterCmd("getrawchangeaddress", (*GetRawChangeAddressCmd)(nil), flags)
698	MustRegisterCmd("getreceivedbyaccount", (*GetReceivedByAccountCmd)(nil), flags)
699	MustRegisterCmd("getreceivedbyaddress", (*GetReceivedByAddressCmd)(nil), flags)
700	MustRegisterCmd("gettransaction", (*GetTransactionCmd)(nil), flags)
701	MustRegisterCmd("getwalletinfo", (*GetWalletInfoCmd)(nil), flags)
702	MustRegisterCmd("importprivkey", (*ImportPrivKeyCmd)(nil), flags)
703	MustRegisterCmd("keypoolrefill", (*KeyPoolRefillCmd)(nil), flags)
704	MustRegisterCmd("listaccounts", (*ListAccountsCmd)(nil), flags)
705	MustRegisterCmd("listaddressgroupings", (*ListAddressGroupingsCmd)(nil), flags)
706	MustRegisterCmd("listlockunspent", (*ListLockUnspentCmd)(nil), flags)
707	MustRegisterCmd("listreceivedbyaccount", (*ListReceivedByAccountCmd)(nil), flags)
708	MustRegisterCmd("listreceivedbyaddress", (*ListReceivedByAddressCmd)(nil), flags)
709	MustRegisterCmd("listsinceblock", (*ListSinceBlockCmd)(nil), flags)
710	MustRegisterCmd("listtransactions", (*ListTransactionsCmd)(nil), flags)
711	MustRegisterCmd("listunspent", (*ListUnspentCmd)(nil), flags)
712	MustRegisterCmd("lockunspent", (*LockUnspentCmd)(nil), flags)
713	MustRegisterCmd("move", (*MoveCmd)(nil), flags)
714	MustRegisterCmd("sendfrom", (*SendFromCmd)(nil), flags)
715	MustRegisterCmd("sendmany", (*SendManyCmd)(nil), flags)
716	MustRegisterCmd("sendtoaddress", (*SendToAddressCmd)(nil), flags)
717	MustRegisterCmd("setaccount", (*SetAccountCmd)(nil), flags)
718	MustRegisterCmd("settxfee", (*SetTxFeeCmd)(nil), flags)
719	MustRegisterCmd("signmessage", (*SignMessageCmd)(nil), flags)
720	MustRegisterCmd("signrawtransaction", (*SignRawTransactionCmd)(nil), flags)
721	MustRegisterCmd("walletlock", (*WalletLockCmd)(nil), flags)
722	MustRegisterCmd("walletpassphrase", (*WalletPassphraseCmd)(nil), flags)
723	MustRegisterCmd("walletpassphrasechange", (*WalletPassphraseChangeCmd)(nil), flags)
724}
725