                             (into-array args))))))))
 
 (defn account->amount [account]
+    (println (.getAddress account) (.balance account))
     {(.getAddress account)
      (-> account .balance js/Number)})
+
+(defn empty-chan []
+    (let [c (chan)] 
+        (close! c) 
+        c))
 
 (defrecord Client [coin]
     Queries

                (fn []
                    (let [unspent (unspent-amounts this)]
                        (put! return unspent)))
                1000)
            return))
    Operations
    (send-amounts! [this amounts] 
        ((comp chans->chan  map)
            (fn [[address amount]]
                (println address amount)
                (call-method coin "sendTo" address amount))
            amounts))
    (new-address! [this]
        (-> coin

(ns bitsplit-cli.client
    (:use
        [cljs.core.async :only (chan put! close!)]
        [bitsplit.client.protocol :only 
        (Queries addresses unspent-amounts unspent-channel
         Operations send-amounts! new-address!)]
