Advertisement
Guest User

Untitled

a guest
Aug 14th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. dim c as new CURLSMBS
  2.  
  3. dim apikey as string = //apikey
  4. dim apisecret as string = //secretKey
  5.  
  6.  
  7. dim nonceDate as date
  8. nonceDate = new date
  9. dim nonce as string = str(nonceDate.TotalSeconds)
  10.  
  11. dim uri as string = cryptsyApiUrl
  12. dim postData as string = "&method=getinfo&nonce=" + nonce
  13. dim uriMemBlock as MemoryBlock = postData
  14. dim sign as string = EncodeHex(Crypto.HMAC(apiSecret, uriMemBlock, Crypto.Algorithm.SHA512), false)
  15. sign = sign.replace("-", "")
  16. c.SetOptionHTTPheader array("Sign: " + sign, "Key: " + apiKey)
  17.  
  18.  
  19.  
  20. c.OptionURL = uri
  21. c.OptionPostFields = postData
  22. c.SetOptionHTTPheader array("Sign: " + sign, "Key: " + apiKey)
  23. c.OptionVerbose = true
  24. c.CollectDebugData = true
  25. c.CollectOutputData = true
  26. c.OptionSSLVerifyHost = 0
  27. c.OptionSSLVerifyPeer = 0
  28.  
  29. dim e as integer = c.Perform
  30.  
  31. dim data as string = c.OutputData
  32.  
  33. return c.OutputData
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement