Bitcoin Forum
September 21, 2025, 10:05:55 PM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] ICONOMI - Fund Management Platform ❘|❘ ICO OPEN on: September 18, 2016, 03:06:21 PM
great work
2  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][POS]PoSCoin - 100% premined - Pure POS - IPO - Launch 21.04.2014 00:00 CET on: April 05, 2014, 12:45:56 AM
good job. My wallet address is 1EmMqoCFLcgF44B4zDgE6mAiKdCoWzAXme

Thanks.
3  Alternate cryptocurrencies / Altcoin Discussion / Re: Bter API problem on: February 20, 2014, 05:24:07 AM
{"result":"false","message":"Error: invalid data"}  This is the above return result.
4  Alternate cryptocurrencies / Altcoin Discussion / Re: Bter API problem on: February 20, 2014, 05:14:56 AM
private static String generateHMAC(String datas) {

      // final Charset asciiCs = Charset.forName( "utf-8" );
      Mac mac;
      String result = "";
      try {

         SecretKeySpec secretKey;

         try {
            secretKey = new SecretKeySpec(
                  (new BASE64Decoder()).decodeBuffer("**************************************"),
                  "HmacSHA512");
            mac = Mac.getInstance("HmacSHA512");
            mac.init(secretKey);
            final byte[] macData = mac.doFinal(datas.getBytes());
            result = (new BASE64Encoder()).encode(macData);
            
         } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }

         

      } catch (final NoSuchAlgorithmException e) {

      } catch (final InvalidKeyException e) {

      }
      return result;

   }
5  Alternate cryptocurrencies / Altcoin Discussion / Re: Bter API problem on: February 20, 2014, 05:07:09 AM
I have signed the post data.
URL getUrl = new URL("https://bter.com/api/1/private/orderlist");
      HttpURLConnection aConnection = (HttpURLConnection) getUrl
            .openConnection();
      Map<String, String> data = new HashMap<String, String>();
      // data.put("dad", "fff");
      // data.put("order_id", "fff");
      data.put("nonce", String.valueOf(System.currentTimeMillis()));
      String postdata = httpBuildQuery(data);
      String sign = generateHMAC(postdata);
      aConnection.setRequestMethod("POST");
      //aConnection.setDoOutput(true);
      aConnection.setRequestProperty("Key",
            "*************");
      aConnection.setRequestProperty("Sign", sign.replaceAll("\n", ""));
      
      aConnection.connect();
      BufferedReader reader = new BufferedReader(new InputStreamReader(
            aConnection.getInputStream(), "utf-8"));

I dont know what is wrong.
   private static String httpBuildQuery(Map<String, String> data)
         throws UnsupportedEncodingException {
         String result = new String();
           for (String hashkey : data.keySet()) {
               if (result.length() > 0) result += '&';
               try {
                   result += URLEncoder.encode(hashkey, "UTF-8") + "="
                           + URLEncoder.encode(data.get(hashkey), "UTF-8");
               } catch (Exception ex) {
                   // Logger.getLogger(Client.class.getName()).log(Level.SEVERE, null, ex);
               }
           }
           return result;
   }
6  Alternate cryptocurrencies / Altcoin Discussion / Re: Bter API problem on: February 17, 2014, 02:10:22 AM
I use java to access the Restful bter api, the public info can be reached. Once tried private api, it returns "..".
I dont know what is wrong. Maybe sign and key are not matched.
Could u give me a privelege authentication example written in java? Thanks!
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!