 (defn arg-vals-of [args]
   (reduce (fn [acc v] (if (empty? acc) (format "%s" v) (format "%s, %s" acc v))) "" args))
 
-(defn java-fn-name-of [m] (format "btc%s" (normalize-name (:name m))))
+(defn java-fn-name-of [i m] (format "btc%s%s" (normalize-name (:name m)) (if (> i 0) i "")))
 
 (defn java-method-of 
   ([m]
-   (reduce (fn [acc v] (format "%s\n%s" acc v)) (flatten (map (comp (partial java-method-of m) rest) (:arglists m)))))
-  ([m args]
-    (let [n (java-fn-name-of m)
+   (reduce (fn [acc v] (format "%s\n%s" acc v)) (flatten (map-indexed (fn [i v] (java-method-of i m (rest v))) (:arglists m)))))
+  ([i m args]
+    (let [n (java-fn-name-of i m)
           args (map normalize-name args)
           arg-vals (arg-vals-of args)]
       ["/**" 

  ]
  ))

(defn java-signature-of [m]
  (format "buildSignatureFromThreadSafeMethod(\"%s\")" (java-fn-name-of m))
  )

(defn java-plugin-source-of [package classname]
  (reduce (fn [acc v] (format "%s\n%s" acc v)) [

;== Util ==
(def-rpc createmultisig nrequired the-keys)
(def-rpc estimatefee nblocks)
;(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)
