Bitcoin Forum
April 20, 2024, 04:13:51 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21]  All
  Print  
Author Topic: [BETA] MTGox websocket API, testers wanted  (Read 77606 times)
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
October 21, 2013, 09:28:28 PM
 #401

Then subscribe:

{"op":"mtgox.subscribe","key":"GhXJXwx..."}

... and I don't get any response to the subscribe message and after sending orders or their execution I don't get any messages in the private "own" channel.

What am I doing wrong?

Thank you!

Mt. Gox has been sending a message that my key is not valid. Are you seeing a "remark" message coming in after you attempt to subscribe?

My guess: Either the API has changed, or the private-channel server is down.

1713586431
Hero Member
*
Offline Offline

Posts: 1713586431

View Profile Personal Message (Offline)

Ignore
1713586431
Reply with quote  #2

1713586431
Report to moderator
1713586431
Hero Member
*
Offline Offline

Posts: 1713586431

View Profile Personal Message (Offline)

Ignore
1713586431
Reply with quote  #2

1713586431
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713586431
Hero Member
*
Offline Offline

Posts: 1713586431

View Profile Personal Message (Offline)

Ignore
1713586431
Reply with quote  #2

1713586431
Report to moderator
alikim
Member
**
Offline Offline

Activity: 80
Merit: 11


View Profile
October 22, 2013, 02:44:04 AM
 #402

Then subscribe:

{"op":"mtgox.subscribe","key":"GhXJXwx..."}

... and I don't get any response to the subscribe message and after sending orders or their execution I don't get any messages in the private "own" channel.

What am I doing wrong?

Thank you!

Mt. Gox has been sending a message that my key is not valid. Are you seeing a "remark" message coming in after you attempt to subscribe?

My guess: Either the API has changed, or the private-channel server is down.

Yes, if I artificially add another symbol at the end of the key in subscribe call, I get that message that the key is not valid.

If I subscribe with the key as it is, I get no message, no error neither success.

Do I understand it right that you do not sign the subscribe message?
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
October 22, 2013, 03:07:42 AM
 #403

Yes, if I artificially add another symbol at the end of the key in subscribe call, I get that message that the key is not valid.

If I subscribe with the key as it is, I get no message, no error neither success.

Do I understand it right that you do not sign the subscribe message?

Interesting. I am sending the key as-is and getting an 'invalid key' message.

I am not signing the message, simply sending under mtgox.subscribe.

alikim
Member
**
Offline Offline

Activity: 80
Merit: 11


View Profile
October 22, 2013, 01:13:01 PM
 #404

Yes, if I artificially add another symbol at the end of the key in subscribe call, I get that message that the key is not valid.

If I subscribe with the key as it is, I get no message, no error neither success.

Do I understand it right that you do not sign the subscribe message?

Interesting. I am sending the key as-is and getting an 'invalid key' message.

I am not signing the message, simply sending under mtgox.subscribe.

All is good now, you were right, the private channel server must have been down.
Clark
Hero Member
*****
Offline Offline

Activity: 548
Merit: 502


So much code.


View Profile WWW
October 23, 2013, 08:09:49 PM
 #405

All is good now, you were right, the private channel server must have been down.

I am continuing to experience the same problem.

Steps I am doing:

1. Grab the idkey from either /1/generic/private/idkey or /2/money/idkey.
2. Over WebSocket, send {"op":"mtgox.subscribe","key":"idkey_as_from_API_call"}
3. Get response over WebSocket socket: {"message":"Invalid key provided","op":"remark","success":false}

@alikim You say it works for you. Can you verify the message you are sending over the WebSocket to subscribe to the private channel.

prof7bit
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
October 24, 2013, 02:30:43 PM
 #406

This is what I do (python code) and it works (doesn't seem to have ever changed, I never had to change my code):

Code:
self.client.send(json.dumps({"op":"mtgox.subscribe", "key":result}))

result contains the idkey exactly as it resulted from the idkey request. The above code is from goxapi.py around line 1497 in the on_op_result() method.

alikim
Member
**
Offline Offline

Activity: 80
Merit: 11


View Profile
October 27, 2013, 07:10:37 AM
Last edit: October 27, 2013, 07:24:34 AM by alikim
 #407

All is good now, you were right, the private channel server must have been down.

I am continuing to experience the same problem.

Steps I am doing:

1. Grab the idkey from either /1/generic/private/idkey or /2/money/idkey.
2. Over WebSocket, send {"op":"mtgox.subscribe","key":"idkey_as_from_API_call"}
3. Get response over WebSocket socket: {"message":"Invalid key provided","op":"remark","success":false}

@alikim You say it works for you. Can you verify the message you are sending over the WebSocket to subscribe to the private channel.


This is what I do over the websocket, the first message is a signed encrypted one:

{"call":"idkey","id":"2a4b88398c872f7150ea4f3a6f.....","nonce":13828......}

The response:

{"id":"2a4b88398c872f7150ea4f.....","op":"result","result":"GhXJXwx......."}

Subscribe command, goes out as plain text:

{"op":"mtgox.subscribe","key":"GhXJXwx......."}

After that I don't receive anything, but the private channel - when /if it's up - will send it's proper messages, for example when you place an order.

I believe if the channel is not working it just won't send you messages but you can still get silently subscribed.

Maybe it's working over the websocket but not working over http API?

Programming and maintenance of various gox servers and services is very sloppy to say the least, these people don't seem to care much...


P.S. On second thought, do you grab the key from http API and then try to use it in websocket API?
Maybe all three steps you've mentioned should go through the websocket, including step one (not using  /1/generic/private/idkey or /2/money/idkey); the websocket will accept the key issued only through the websocket message?
alikim
Member
**
Offline Offline

Activity: 80
Merit: 11


View Profile
October 27, 2013, 07:37:41 AM
 #408

In case any developer is following this thread I added a suggestion about the websocket API here:

https://bitcointalk.org/index.php?topic=319546.0
frito
Full Member
***
Offline Offline

Activity: 129
Merit: 100


View Profile
December 27, 2013, 07:44:11 PM
 #409

Hi websocket uber pros,

I have been testing GOX websocket stream using Xchange java framework.

There are horrible data gaps(sometimes 90% of quotes missed) and lags all the time, both the book and the ticker.

Is the gox websocket crap? Or is the problem with the Xchange implementation or the websocket java lib?
Any idea suggestion or wisdom is welcomed.

thx
f
prof7bit
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
December 27, 2013, 08:35:33 PM
 #410

Is the gox websocket crap? Or is the problem with the Xchange implementation or the websocket java lib?
Any idea suggestion or wisdom is welcomed.

MtGox websocket is excellent, 99.9% uptime and <200ms delay. Try goxtool (see my sig) for a proper implementation and reference.

Praeconium
Member
**
Offline Offline

Activity: 102
Merit: 10


View Profile
January 02, 2014, 11:25:14 PM
 #411

This is what I do (python code) and it works (doesn't seem to have ever changed, I never had to change my code):

Code:
self.client.send(json.dumps({"op":"mtgox.subscribe", "key":result}))

result contains the idkey exactly as it resulted from the idkey request. The above code is from goxapi.py around line 1497 in the on_op_result() method.

Is it anyhow possible to add a module which would collect info and construct historical database of orderbook and trades?

Zicore47
Sr. Member
****
Offline Offline

Activity: 471
Merit: 262


View Profile
January 21, 2014, 09:54:26 AM
 #412

I subscribed to the market depth channel via the websocket and I'm parsing the data with Json.net (c#), but there is a problem when I receive a volume in scientific notation.

The volume is treated as string whenever it is in scientific notation and this leads to problems with parsing.

Code:
"volume":"1.0E-8"

In this case Json.Net is unable to parse the string to decimal by default.

To get around this, I currently use this construct:

Code:
        public decimal Volume
        {
            get { return _volume; }
            set { _volume = value; }
        }

        [JsonProperty("volume", Required = Required.Always)]
        public String VolumeString
        {
            get { return Volume.ToString(CultureInfo.InvariantCulture); }
            set { Volume = Decimal.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture); }
        }

Any suggestions ?

Cointracking und Steuertool - Cointracking and tax reports: Cointracking.info
Spare 10% mit diesem link. Save 10% on purchases with this link.
prof7bit
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
January 21, 2014, 10:16:39 AM
 #413

Any suggestions ?
Use the integer values for everything, they are contained in every json object that carries any numbers. For BTC (order volume) they represent integer number of satoshi, for fiat currency (quote prices) they represent either 1e-5 or 1e-3 units of the quote currency (depends on what currency it is, USD and most others is 1e-5, JPY and SEK its 1e-3).

prof7bit
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
February 18, 2014, 04:44:34 PM
 #414

i doubt it, btw thx
Doubt what? Just have look at the json that is sent by gox and see for yourself what it contains!

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21]  All
  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!