This is complicated for me… but might be easy for you
I need to convert this PHP to xojo:
For this version, we use a standard HMAC-SHA512 signing. Append apikey and nonce to your request and calculate the HMAC hash and include it under an apisign header. Note: the nonce is not respected right now but will be enforced later.
Here is my attempt… which has yielded a badly formed request error. This is using MBS CURL plugin, but I’m willing to do whatever it takes…
[code] const apikey="900390c9267c5b5dcb21cff62b1ef "
const apisecret=“4fb35ab532464cd9a48f5db2bfa”
dim nonceDate as date
nonceDate = new date
dim nonce as string = str(nonceDate.TotalSeconds)
dim uri as string = “https://bittrex.com/api/v1.1/market/getopenorders?apikey=” + apikey + “&nonce=” + nonce
dim uriMemBlock as MemoryBlock = uri
dim sign as string = EncodeHex(Crypto.HMAC(apiSecret, uriMemBlock, Crypto.Algorithm.SHA512), false)
dim data as string = c.OutputData
TextArea1.text = data[/code]
My hunch is that… there’s some specific type of output that the PHP is putting out that xojo is not putting out as a request that is messing it up. Please help… I have paypal and bitcoin to use to pay to get this to work! Thanks
[code] const apikey=“900390c9267c5b5dcb21cff62b1ef”
const apisecret=“4fb35ab532464cd9a48f5db2bfa”
dim nonceDate as date
nonceDate = new date
dim nonce as string = str(nonceDate.TotalSeconds)
dim uri as string = “https://bittrex.com/api/v1.1/market/getopenorders?apikey=” + apikey + “&nonce=” + nonce
dim uriMemBlock as MemoryBlock = uri
dim sign as string = EncodeHex(Crypto.HMAC(apiSecret, uriMemBlock, Crypto.Algorithm.SHA512), false)
dim h as new HTTPSecureSocket
h.SetRequestHeader “apisign:” , sign
dim resp as string = h.Get(uri, 45)
break[/code]
with the trailing space on the API key you get a “request is badly formed” reply
remove that trailing space & you get “invalid api key” - which suggests its properly formed but invalid credentials
I figured the nonce was not limited to anything special… but its funny because i took one look at @Norman Palardy 's suggestion and nearly dismissed it instantly cause i thought there’s no way i left that space in the actual code and even if i did it couldn’t be that… and whatddya know ? It was that… and I no am able to access API no problem thanks!
Christian I really appreciate your help too, I wish there was a tip system built into the forums they should get on that There’s gotta be a way to plugin something for bitcoin. Anyhow i got it all working and now, I venture off to learn about parsing Json. Wish me luck and thanks again. I was sure it was going to be something super complex but… apparently it was just a typo.