Author

Topic: Suche jemand der uns bezüglich bitstamp API hilft (Read 1726 times)

legendary
Activity: 966
Merit: 1000
Und was war die Lösung?
haben einen "freelancer" gefunden der uns die api komplett aufbereitet hat inkl. kleiner doku...  klar hat das bisle was gekostet -> die arbeit war bzw. ist aber echt gut....

was genau falsch war -> kann ich nicht sagen...
legendary
Activity: 2618
Merit: 1007
Und was war die Lösung?
legendary
Activity: 966
Merit: 1000
kann gelöscht werden -> habe jemand gefunden der super geholfen hat....
legendary
Activity: 966
Merit: 1000
hey...

suche jemand der uns bezüglich bitstamp api kurz unter die arme greift...

sprache: vb net

wir erhalten immer die meldung:

Code:
{"error": "Missing key, signature and nonce parameters"}

code:
Code:
Dim api_key As String = "zkhzfkxfjxfjkzzzfjkxjfjnxfj"
    Dim api_secret As String = "zkhzfkxfjxfjkzzzfjkxjfjnxfj"
    Dim client_id As String = "10203040"

    Public Function check_balance()
        Try

            Dim NONCE As String = DateTime.Now.Ticks
            Dim SIGNATURE As String = CreateSignature(NONCE)

            Dim request As HttpWebRequest
            request = DirectCast(WebRequest.Create("https://www.bitstamp.net/api/balance/"), HttpWebRequest)

            request.Accept = True
            request.Method = "POST"
            request.Headers("key") = api_key
            request.Headers("nonce") = NONCE
            request.Headers("signature") = SIGNATURE
            request.AllowAutoRedirect = True
            request.AllowWriteStreamBuffering = True
            request.KeepAlive = True

            Dim response As HttpWebResponse = Nothing
            Dim reader As StreamReader = Nothing
            Dim result As String = Nothing
            Try
                response = DirectCast(request.GetResponse(), HttpWebResponse)
                reader = New StreamReader(response.GetResponseStream())
                result = reader.ReadToEnd()
                RichTextBox1.Text = (result)
            Catch ex As Exception
                Return ex.ToString()
            Finally
                If Not response Is Nothing Then response.Close()
            End Try

            Return result
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Function

    Private Function CreateSignature(ByVal Nonce As String) As String
        Dim msg As String = String.Format("{0}{1}{2}", Nonce, client_id, api_key)

        Return ByteArrayToString(SignHMACSHA256(api_secret, StringToByteArray(msg))).ToUpper()
    End Function

Private Shared Function SignHMACSHA256(key As [String], data As Byte()) As Byte()
        Dim hashMaker As New HMACSHA256(Encoding.ASCII.GetBytes(key))
        Return hashMaker.ComputeHash(data)
    End Function

    Private Shared Function StringToByteArray(str As String) As Byte()
        Return System.Text.Encoding.ASCII.GetBytes(str)
    End Function

    Private Shared Function ByteArrayToString(hash As Byte()) As String
        Return BitConverter.ToString(hash).Replace("-", "").ToLower()
    End Function

bin gerne bereits bisle was bei erfolg auf deine wallet zu spenden...
Jump to: