[b]You need to have a working knowledge of the MBSCURLS xojo plugin. Some experience working with signed API requests is a plus. You also need at least passing knowledge of VB.net.
The task: Simply translate this VB.net code into XOJO using MBSCURLS and you get [h]$50 in shiny bitcoins.[/h][/b]
[code]Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Security.Cryptography
Dim pKey As String = “Public Key Here”
Dim sKey As String = “Private Key Here”
Private Sub CancelAll()
Dim postReq As HttpWebRequest = DirectCast(WebRequest.Create(“https://www.Cryptsy.com/api”), HttpWebRequest)
Dim randomn As String = CLng(DateTime.UtcNow.Subtract(New DateTime(1970, 1, 1)).TotalSeconds)
'//Dependant upon Method
Dim postData As String = “method=cancelallorders&nonce=” & randomn
'//Start Encryption
Dim KeyByte() As Byte = Encoding.ASCII.GetBytes(sKey)
Dim HMAcSha As New HMACSHA512(Encoding.ASCII.GetBytes(sKey))
Dim messagebyte() As Byte = Encoding.ASCII.GetBytes(postData)
Dim hashmessage() As Byte = HMAcSha.ComputeHash(messagebyte)
Dim Sign As String = BitConverter.ToString(hashmessage)
Sign = Sign.Replace("-", “”)
'//Generate Post Information
postReq.Method = “POST”
postReq.KeepAlive = False
postReq.Headers.Add(“Key”, pKey)
postReq.Headers.Add(“Sign”, LCase(Sign))
postReq.ContentType = “application/x-www-form-urlencoded”
postReq.UserAgent = “Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729)”
postReq.ContentLength = messagebyte.Length
Try
'//Send Request
Dim postreqstream As Stream = postReq.GetRequestStream()
postreqstream.Write(messagebyte, 0, messagebyte.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postReq.GetResponse(), HttpWebResponse)
Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
'The Response Text
Dim thepage As String = postreqreader.ReadToEnd
thepage = thepage.Replace(Chr(34), Chr(39))
Scratchpad.Text = Scratchpad.Text & vbNewLine & thepage
Catch ex As Exception
Scratchpad.Text = Scratchpad.Text & vbNewLine & "Cancel All Orders: " & ex.Message
End Try
End Sub
[/code]