decred.org/dcrwallet/v3@v3.1.0/internal/rpchelp/methods.go (about)

     1  // Copyright (c) 2015 The btcsuite developers
     2  // Copyright (c) 2015-2021 The Decred developers
     3  // Use of this source code is governed by an ISC
     4  // license that can be found in the LICENSE file.
     5  
     6  //go:build !generate
     7  
     8  package rpchelp
     9  
    10  import (
    11  	"decred.org/dcrwallet/v3/rpc/jsonrpc/types"
    12  	dcrdtypes "github.com/decred/dcrd/rpc/jsonrpc/types/v4"
    13  )
    14  
    15  // Common return types.
    16  var (
    17  	returnsBool        = []interface{}{(*bool)(nil)}
    18  	returnsNumber      = []interface{}{(*float64)(nil)}
    19  	returnsString      = []interface{}{(*string)(nil)}
    20  	returnsStringArray = []interface{}{(*[]string)(nil)}
    21  	returnsLTRArray    = []interface{}{(*[]types.ListTransactionsResult)(nil)}
    22  )
    23  
    24  // Methods contains all methods and result types that help is generated for,
    25  // for every locale.
    26  var Methods = []struct {
    27  	Method      string
    28  	ResultTypes []interface{}
    29  }{
    30  	{"abandontransaction", nil},
    31  	{"accountaddressindex", []interface{}{(*int)(nil)}},
    32  	{"accountsyncaddressindex", nil},
    33  	{"accountunlocked", []interface{}{(*types.AccountUnlockedResult)(nil)}},
    34  	{"addmultisigaddress", returnsString},
    35  	{"addtransaction", nil},
    36  	{"auditreuse", []interface{}{(*map[string][]string)(nil)}},
    37  	{"consolidate", returnsString},
    38  	{"createmultisig", []interface{}{(*types.CreateMultiSigResult)(nil)}},
    39  	{"createnewaccount", nil},
    40  	{"createrawtransaction", returnsString},
    41  	{"createsignature", []interface{}{(*types.CreateSignatureResult)(nil)}},
    42  	{"disapprovepercent", []interface{}{(*uint32)(nil)}},
    43  	{"discoverusage", nil},
    44  	{"dumpprivkey", returnsString},
    45  	{"fundrawtransaction", []interface{}{(*types.FundRawTransactionResult)(nil)}},
    46  	{"getaccount", returnsString},
    47  	{"getaccountaddress", returnsString},
    48  	{"getaddressesbyaccount", returnsStringArray},
    49  	{"getbalance", []interface{}{(*types.GetBalanceResult)(nil)}},
    50  	{"getbestblock", []interface{}{(*dcrdtypes.GetBestBlockResult)(nil)}},
    51  	{"getbestblockhash", returnsString},
    52  	{"getblockcount", returnsNumber},
    53  	{"getblockhash", returnsString},
    54  	{"getblockheader", []interface{}{(*dcrdtypes.GetBlockHeaderVerboseResult)(nil)}},
    55  	{"getblock", []interface{}{(*dcrdtypes.GetBlockVerboseResult)(nil)}},
    56  	{"getcoinjoinsbyacct", []interface{}{(*map[string]uint32)(nil)}},
    57  	{"getcurrentnet", []interface{}{(*uint32)(nil)}},
    58  	{"getinfo", []interface{}{(*types.InfoWalletResult)(nil)}},
    59  	{"getmasterpubkey", []interface{}{(*string)(nil)}},
    60  	{"getmultisigoutinfo", []interface{}{(*types.GetMultisigOutInfoResult)(nil)}},
    61  	{"getnewaddress", returnsString},
    62  	{"getpeerinfo", []interface{}{(*types.GetPeerInfoResult)(nil)}},
    63  	{"getrawchangeaddress", returnsString},
    64  	{"getreceivedbyaccount", returnsNumber},
    65  	{"getreceivedbyaddress", returnsNumber},
    66  	{"getstakeinfo", []interface{}{(*types.GetStakeInfoResult)(nil)}},
    67  	{"gettickets", []interface{}{(*types.GetTicketsResult)(nil)}},
    68  	{"gettransaction", []interface{}{(*types.GetTransactionResult)(nil)}},
    69  	{"gettxout", []interface{}{(*dcrdtypes.GetTxOutResult)(nil)}},
    70  	{"getunconfirmedbalance", returnsNumber},
    71  	{"getvotechoices", []interface{}{(*types.GetVoteChoicesResult)(nil)}},
    72  	{"getwalletfee", returnsNumber},
    73  	{"getcfilterv2", []interface{}{(*types.GetCFilterV2Result)(nil)}},
    74  	{"help", append(returnsString, returnsString[0])},
    75  	{"importcfiltersv2", nil},
    76  	{"importprivkey", nil},
    77  	{"importpubkey", nil},
    78  	{"importscript", nil},
    79  	{"importxpub", nil},
    80  	{"listaccounts", []interface{}{(*map[string]float64)(nil)}},
    81  	{"listaddresstransactions", returnsLTRArray},
    82  	{"listalltransactions", returnsLTRArray},
    83  	{"listlockunspent", []interface{}{(*[]dcrdtypes.TransactionInput)(nil)}},
    84  	{"listreceivedbyaccount", []interface{}{(*[]types.ListReceivedByAccountResult)(nil)}},
    85  	{"listreceivedbyaddress", []interface{}{(*[]types.ListReceivedByAddressResult)(nil)}},
    86  	{"listsinceblock", []interface{}{(*types.ListSinceBlockResult)(nil)}},
    87  	{"listtransactions", returnsLTRArray},
    88  	{"listunspent", []interface{}{(*types.ListUnspentResult)(nil)}},
    89  	{"lockaccount", nil},
    90  	{"lockunspent", returnsBool},
    91  	{"mixaccount", nil},
    92  	{"mixoutput", nil},
    93  	{"purchaseticket", returnsString},
    94  	{"processunmanagedticket", nil},
    95  	{"redeemmultisigout", []interface{}{(*types.RedeemMultiSigOutResult)(nil)}},
    96  	{"redeemmultisigouts", []interface{}{(*types.RedeemMultiSigOutResult)(nil)}},
    97  	{"renameaccount", nil},
    98  	{"rescanwallet", nil},
    99  	{"sendfrom", returnsString},
   100  	{"sendfromtreasury", returnsString},
   101  	{"sendmany", returnsString},
   102  	{"sendrawtransaction", returnsString},
   103  	{"sendtoaddress", returnsString},
   104  	{"sendtomultisig", returnsString},
   105  	{"sendtotreasury", returnsString},
   106  	{"setaccountpassphrase", nil},
   107  	{"setdisapprovepercent", nil},
   108  	{"settreasurypolicy", nil},
   109  	{"settspendpolicy", nil},
   110  	{"settxfee", returnsBool},
   111  	{"setvotechoice", nil},
   112  	{"signmessage", returnsString},
   113  	{"signrawtransaction", []interface{}{(*types.SignRawTransactionResult)(nil)}},
   114  	{"signrawtransactions", []interface{}{(*types.SignRawTransactionsResult)(nil)}},
   115  	{"stakepooluserinfo", []interface{}{(*types.StakePoolUserInfoResult)(nil)}},
   116  	{"sweepaccount", []interface{}{(*types.SweepAccountResult)(nil)}},
   117  	{"syncstatus", []interface{}{(*types.SyncStatusResult)(nil)}},
   118  	{"ticketinfo", []interface{}{(*[]types.TicketInfoResult)(nil)}},
   119  	{"ticketsforaddress", returnsBool},
   120  	{"treasurypolicy", []interface{}{(*[]types.TreasuryPolicyResult)(nil), (*types.TreasuryPolicyResult)(nil)}},
   121  	{"tspendpolicy", []interface{}{(*[]types.TSpendPolicyResult)(nil), (*types.TSpendPolicyResult)(nil)}},
   122  	{"unlockaccount", nil},
   123  	{"validateaddress", []interface{}{(*types.ValidateAddressWalletResult)(nil)}},
   124  	{"validatepredcp0005cf", returnsBool},
   125  	{"verifymessage", returnsBool},
   126  	{"version", []interface{}{(*map[string]dcrdtypes.VersionResult)(nil)}},
   127  	{"walletinfo", []interface{}{(*types.WalletInfoResult)(nil)}},
   128  	{"walletislocked", returnsBool},
   129  	{"walletlock", nil},
   130  	{"walletpassphrase", nil},
   131  	{"walletpassphrasechange", nil},
   132  	{"walletpubpassphrasechange", nil},
   133  }
   134  
   135  // HelpDescs contains the locale-specific help strings along with the locale.
   136  var HelpDescs = []struct {
   137  	Locale   string // Actual locale, e.g. en_US
   138  	GoLocale string // Locale used in Go names, e.g. EnUS
   139  	Descs    map[string]string
   140  }{
   141  	{"en_US", "EnUS", helpDescsEnUS}, // helpdescs_en_US.go
   142  }