 (s/fdef getdifficulty :ret integer?) 
 (def-rpc getdifficulty)
 
-(def-rpc-opt getmempoolancestors txid verbose)
-(def-rpc-opt getmempooldescendants txid verbose)
+(def-rpc-opt getmempoolancestors 1 txid verbose)
+(def-rpc-opt getmempooldescendants 1 txid verbose)
 (def-rpc getmempoolentry txid)
 (def-rpc getmempoolinfo)
-(def-rpc-opt getrawmempool verbose)
-(def-rpc-opt gettxout txid n include_mempool)
+(def-rpc-opt getrawmempool 0 verbose)
+(def-rpc-opt gettxout 2 txid n include_mempool)
 
 (s/fdef gettxoutproof :args (s/alt :verbose (s/cat :txids vector?), :choice (s/cat :txids vector?, :blockhash boolean?)) :ret ::hex-string)
 (def-rpc gettxoutproof txids blockhash)

(def-rpc stop)

;== Generating ==
(def-rpc-opt generate nblocks maxtries)
(def-rpc-opt generatetoaddress nblocks address maxtries)

;== Mining ==
(def-rpc-opt getblocktemplate TemplateRequest )
(def-rpc getmininginfo)
;getnetworkhashps ( nblocks height )
;prioritisetransaction <txid> <priority delta> <fee delta>
(def-rpc-opt submitblock hexdata jsonparametersobject)

;== Network ==
(def-rpc addnode node action)
(def-rpc clearbanned)
(def-rpc disconnectnode address) 
(def-rpc-opt getaddednodeinfo node)
(def-rpc getconnectioncount)
(def-rpc getnettotals)
(def-rpc getnetworkinfo)
(def-rpc getpeerinfo)
(def-rpc listbanned)
(def-rpc ping)
;setban "subnet" "add|remove" (bantime) (absolute)
(def-rpc setnetworkactive b)

;== Rawtransactions ==
;createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )
(def-rpc decoderawtransaction hexstring)
(def-rpc decodescript hexstring)
(def-rpc-opt fundrawtransaction hexstring options)
(def-rpc-opt getrawtransaction txid  verbose)
(def-rpc-opt sendrawtransaction hexstring allowhighfees)
;signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )

;== Util ==

(def-rpc estimatepriority nblocks)
(def-rpc estimatesmartfee nblocks)
(def-rpc estimatesmartpriority nblocks)

(s/fdef signmessagewithprivkey :args (s/cat :privkey string?, :message string?) :ret ::signature)
(def-rpc signmessagewithprivkey privkey message)

(s/fdef validateaddress :args (s/cat :address ::address) :ret map?)
(def-rpc validateaddress address)

(def-rpc verifymessage address signature message)

;== Wallet ==
(def-rpc abandontransaction txid)
(def-rpc-opt addmultisigaddress 2 nrequired the-keys account)
(def-rpc addwitnessaddress address)
(def-rpc backupwallet destination)
(def-rpc-opt bumpfee 1 txid options) 
(def-rpc dumpprivkey address)
(def-rpc dumpwallet filename)
(def-rpc encryptwallet passphrase)
