-
Notifications
You must be signed in to change notification settings - Fork 43
/
methods.go
116 lines (109 loc) · 4.66 KB
/
methods.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright (c) 2015 The btcsuite developers
// Copyright (c) 2015-2017 The Decred developers
// Copyright (c) 2018-2020 The Hc developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
//+build !generate
package rpchelp
import "github.com/HcashOrg/hcd/hcjson"
// Common return types.
var (
returnsBool = []interface{}{(*bool)(nil)}
returnsNumber = []interface{}{(*float64)(nil)}
returnsString = []interface{}{(*string)(nil)}
returnsStringArray = []interface{}{(*[]string)(nil)}
returnsLTRArray = []interface{}{(*[]hcjson.ListTransactionsResult)(nil)}
)
// Methods contains all methods and result types that help is generated for,
// for every locale.
var Methods = []struct {
Method string
ResultTypes []interface{}
}{
{"accountaddressindex", []interface{}{(*int)(nil)}},
{"accountsyncaddressindex", nil},
{"addmultisigaddress", returnsString},
{"consolidate", returnsString},
{"createmultisig", []interface{}{(*hcjson.CreateMultiSigResult)(nil)}},
{"dumpprivkey", returnsString},
{"getaccount", returnsString},
{"getaccountaddress", returnsString},
{"getaddressesbyaccount", returnsStringArray},
{"getbalance", append(returnsNumber, returnsNumber[0])},
{"getbestblockhash", returnsString},
{"getblockcount", returnsNumber},
{"getinfo", []interface{}{(*hcjson.InfoWalletResult)(nil)}},
{"getmasterpubkey", []interface{}{(*string)(nil)}},
{"getmultisigoutinfo", []interface{}{(*hcjson.GetMultisigOutInfoResult)(nil)}},
{"getnewaddress", returnsString},
{"getrawchangeaddress", returnsString},
{"getreceivedbyaccount", returnsNumber},
{"getreceivedbyaddress", returnsNumber},
{"gettickets", []interface{}{(*hcjson.GetTicketsResult)(nil)}},
{"gettransaction", []interface{}{(*hcjson.GetTransactionResult)(nil)}},
{"getvotechoices", []interface{}{(*hcjson.GetVoteChoicesResult)(nil)}},
{"help", append(returnsString, returnsString[0])},
{"importprivkey", nil},
{"importscript", nil},
{"keypoolrefill", nil},
{"listaccounts", []interface{}{(*map[string]float64)(nil)}},
{"listlockunspent", []interface{}{(*[]hcjson.TransactionInput)(nil)}},
{"listreceivedbyaccount", []interface{}{(*[]hcjson.ListReceivedByAccountResult)(nil)}},
{"listreceivedbyaddress", []interface{}{(*[]hcjson.ListReceivedByAddressResult)(nil)}},
{"listsinceblock", []interface{}{(*hcjson.ListSinceBlockResult)(nil)}},
{"listtransactions", returnsLTRArray},
{"listunspent", []interface{}{(*hcjson.ListUnspentResult)(nil)}},
{"lockunspent", returnsBool},
{"redeemmultisigout", []interface{}{(*hcjson.RedeemMultiSigOutResult)(nil)}},
{"redeemmultisigouts", []interface{}{(*hcjson.RedeemMultiSigOutResult)(nil)}},
{"rescanwallet", nil},
{"revoketickets", nil},
{"sendfrom", returnsString},
{"sendmany", returnsString},
{"sendmanyv2", returnsString},
{"sendtoaddress", returnsString},
{"sendfromaddresstoaddress", returnsString},
{"sendtomultisig", returnsString},
{"settxfee", returnsBool},
{"setvotechoice", nil},
{"signmessage", returnsString},
{"signrawtransaction", []interface{}{(*hcjson.SignRawTransactionResult)(nil)}},
{"signrawtransactions", []interface{}{(*hcjson.SignRawTransactionsResult)(nil)}},
{"validateaddress", []interface{}{(*hcjson.ValidateAddressWalletResult)(nil)}},
{"verifymessage", returnsBool},
{"version", []interface{}{(*map[string]hcjson.VersionResult)(nil)}},
{"walletlock", nil},
{"walletpassphrase", nil},
{"walletpassphrasechange", nil},
{"createnewaccount", nil},
{"exportwatchingwallet", returnsString},
{"getbestblock", []interface{}{(*hcjson.GetBestBlockResult)(nil)}},
{"getunconfirmedbalance", returnsNumber},
{"listaddresstransactions", returnsLTRArray},
{"listalltransactions", returnsLTRArray},
{"renameaccount", nil},
{"walletislocked", returnsBool},
{"walletinfo", []interface{}{(*hcjson.WalletInfoResult)(nil)}},
// TODO Alphabetize
{"purchaseticket", returnsString},
{"sendtossrtx", returnsString},
{"sendtosstx", returnsString},
{"sendtossgen", returnsString},
{"generatevote", []interface{}{(*hcjson.GenerateVoteResult)(nil)}},
{"getstakeinfo", []interface{}{(*hcjson.GetStakeInfoResult)(nil)}},
{"getticketfee", returnsNumber},
{"setticketfee", returnsBool},
{"getwalletfee", returnsNumber},
{"addticket", nil},
{"listscripts", []interface{}{(*hcjson.ListScriptsResult)(nil)}},
{"stakepooluserinfo", []interface{}{(*hcjson.StakePoolUserInfoResult)(nil)}},
{"ticketsforaddress", returnsBool},
}
// HelpDescs contains the locale-specific help strings along with the locale.
var HelpDescs = []struct {
Locale string // Actual locale, e.g. en_US
GoLocale string // Locale used in Go names, e.g. EnUS
Descs map[string]string
}{
{"en_US", "EnUS", helpDescsEnUS}, // helpdescs_en_US.go
}