Bitcoin Forum
June 20, 2024, 08:58:54 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Suche jemand der uns bezüglich bitstamp API hilft  (Read 1704 times)
Wolke (OP)
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
November 15, 2014, 06:13:06 PM
 #1

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...

Wolke (OP)
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
November 16, 2014, 12:20:52 PM
 #2

kann gelöscht werden -> habe jemand gefunden der super geholfen hat....

Sukrim
Legendary
*
Offline Offline

Activity: 2618
Merit: 1006


View Profile
November 22, 2014, 03:00:20 PM
 #3

Und was war die Lösung?

https://www.coinlend.org <-- automated lending at various exchanges.
https://www.bitfinex.com <-- Trade BTC for other currencies and vice versa.
Wolke (OP)
Legendary
*
Offline Offline

Activity: 966
Merit: 1000


View Profile
November 22, 2014, 03:18:58 PM
 #4

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...

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!