 (defmacro def-rpc [name & args]
   `(defn ~name ~(get-description name) [~@args] (btc-rpc ~(str name) ~@args))) 
 
-(defmacro def-rpc-opt [name & args]
+(defmacro def-rpc-opt [name n & args]
   `(defn ~name ~(get-description name) 
      ([~@args] (btc-rpc ~(str name) ~@args))
-     ([~@(butlast args)] (btc-rpc ~(str name) ~@(butlast args)))
+     ([~@(take n args)] (btc-rpc ~(str name) ~@(take n args)))
      ))
-(defmacro def-rpc-all-opt [name & args]
-  `(defn ~name ~(get-description name) 
-     ([~@args] (btc-rpc ~(str name) ~@args))
-     ([] (btc-rpc ~(str name)))
-     ))
+
 
 ;;--------RPC calls-----------
 
-;blockchain
+;== Blockchain ==
 
 (s/fdef getbestblockhash :ret string?)
 (def-rpc getbestblockhash)
 
 (s/fdef getblock :args (s/alt :verbose (s/cat :block-hash string?), :choice (s/cat :block-hash string?, :verbose boolean?)) :ret map?)
-(def-rpc-opt getblock block-hash verbose)
+(def-rpc-opt getblock 1 block-hash verbose)
 
 (s/fdef getblockchaininfo :ret map?)
 (def-rpc getblockchaininfo)


(defn block-of [block-hash] (getblock block-hash))



(defn print-it [a-list]
  (doseq [l a-list] (println l)))

(s/fdef getdifficulty :ret integer?) 
(def-rpc getdifficulty)

(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 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)
