     
     
     
-    
-    /***
-
-Send Many Transactions
-
-Send a transaction to multiple recipients in the same transaction.
-
-https://blockchain.info/fr/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&shared=$shared&fee=$fee
-
-$main_password Your Main My wallet password
-$second_password Your second My Wallet password if double encryption is enabled.
-$recipients Is a JSON Object using Bitcoin Addresses as keys and the amounts to send as values (See below).
-$from Send from a specific Bitcoin Address (Optional)
-$shared "true" or "false" indicating whether the transaction should be sent through a shared wallet. Fees apply. (Optional)
-$fee Transaction fee value in satoshi (Must be greater than default fee) (Optional)
-$note A public note to include with the transaction (Optional)
-
-{
-"1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh": 100000000,
-"12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT": 1500000000,
-"1dice6YgEVBf88erBFra9BHf6ZMoyvG88": 200000000
-}
-
-The above example would send 1 BTC to 1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh, 15 BTC to 12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT and 2 BTC to 1dice6YgEVBf88erBFra9BHf6ZMoyvG88 in the same transaction.
-Response:
-
-{ "message" : "Response Message" , "tx_hash": "Transaction Hash" }
-
-{ "message" : "Sent To Multiple Recipients" , "tx_hash" : "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c" }
-
-*/
+    /*
+    The above example would send 1 BTC to 1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh, 15 BTC to 12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT and 2 BTC to 1dice6YgEVBf88erBFra9BHf6ZMoyvG88 in the same transaction.
+    Response:
+    
+    { "message" : "Response Message" , "tx_hash": "Transaction Hash" }
+    
+    { "message" : "Sent To Multiple Recipients" , "tx_hash" : "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c" }
+    
+    */
+
+    /*
+    //TODO : untested
+    Send Many Transactions
+    Send a transaction to multiple recipients in the same transaction.. All transactions include a 0.0001 BTC miners fee.
+    -> mainPassword : Your Main My wallet password
+    -> secondPassword : Your second My Wallet password if double encryption is enabled.
+    -> from : Send from a specific Bitcoin Address (Optional)
+    -> to : Send an NSDictionnary like this
+    {
+    "1JzSZFs2DQke2B3S4pBxaNaMzzVZaG4Cqh": 100000000,
+    "12Cf6nCcRtKERh9cQm3Z29c9MWvQuFSxvT": 1500000000,
+    "1dice6YgEVBf88erBFra9BHf6ZMoyvG88": 200000000
+    }
+    shared "true" or "false" indicating whether the transaction should be sent through a shared wallet. Fees apply. (Optional)
+    -> fee : Transaction fee value in satoshi (Must be greater than default fee) (Optional)
+    -> note : A public note to include with the transaction (Optional)
+    Knowed Errors
+    case Unknow
+    */
+    class func makeManyPayments(walletIdentifier : NSString,mainPassword : NSString, secondPassword : NSString, to : NSDictionary,from : NSString,shared : NSNumber,fee : NSNumber,note : NSString, success :(ODPaymentResults) -> Void = {response in /* ... */},failure: (ODBlockChainError) -> Void = {error in /* ... */}) -> Void
+    {
+        
+        var url : NSURL;
+        var request : NSMutableURLRequest;
+        var postKeys : NSMutableString = NSMutableString();
+        
+        var firstCharKeys : NSString = "?";
+        
+        //Parameters
+        postKeys.appendFormat("%@/payment", walletIdentifier);
+        
+        postKeys.appendFormat("%@main_password=%@", firstCharKeys, mainPassword);
+        
+        firstCharKeys = "&";
+        
+        postKeys.appendFormat("%@second_password=%@", firstCharKeys, secondPassword);
+        
+        var error : NSError?;
+        var data : NSData;
+        
+        data = NSJSONSerialization.dataWithJSONObject(to, options: NSJSONWritingOptions.PrettyPrinted, error: &error);
+        
+        // TODO : can be optimized
+        if(error){
+            failure(ODBlockChainError.parseError("NSDictionnary", result: to.description));
+        }else{
+
+            // TODO : can be optimized
+            postKeys.appendFormat("%@recipients=%@", firstCharKeys, NSString(data: data,encoding: NSUTF8StringEncoding));
+            
+            if(from.length>0){
+                postKeys.appendFormat("%@from=%@", firstCharKeys ,from);
+            }
+            
+            if(!(shared.floatValue==(-1.0))){
+                postKeys.appendFormat("%@shared=%f", firstCharKeys ,shared);
+            }
+            
+            if(fee.floatValue>0){
+                postKeys.appendFormat("%@fee=%f", firstCharKeys ,(fee.floatValue*kBCWalletSatoshi.floatValue));
+            }
+            
+            if(note.length>0){
+                postKeys.appendFormat("%@note=%@", firstCharKeys ,note);
+            }
+            
+            url = NSURL.URLWithString(NSString(format : "%@%@",kBCUrlWalletMerchant,postKeys.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding)));
+            
+            request = NSMutableURLRequest(URL: url, cachePolicy: NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, timeoutInterval:NSTimeInterval(kBCTimeout));
+            
+            ODBlockChainService.manageRequest(request,
+                success:{(object : AnyObject) -> Void in
+                    if(object.isKindOfClass(NSDictionary)){
+                        var dic : NSDictionary = object as NSDictionary;
+                        success(ODPaymentResults.instantiateWithDictionnary(dic));
+                    }else{
+                        failure(ODBlockChainError.parseError(NSDictionary.description(),result:object.description));
+                    }
+                },failure:{(error : ODBlockChainError) -> Void in
+                    failure(error);
+                });
+        }
+    }
+    
 
 }
    ***/
    
    /*
    Making Outgoing Payments
    Send bitcoin from your wallet to another bitcoin address. All transactions include a 0.0001 BTC miners fee.
    -> mainPassword : Your Main My wallet password

        
        postKeys.appendFormat("%@amount=%f", firstCharKeys, (amount.floatValue*kBCWalletSatoshi.floatValue));
        
        postKeys.appendFormat("%@to=%@", firstCharKeys, to);
        
        if(from.length>0){
            postKeys.appendFormat("%@from=%@", firstCharKeys ,from);
        }
