Clark
|
|
October 21, 2013, 09:28:28 PM |
|
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.
|
|
|
|
|
|
|
|
|
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
|
alikim
Member
Offline
Activity: 80
Merit: 11
|
|
October 22, 2013, 02:44:04 AM |
|
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
|
|
October 22, 2013, 03:07:42 AM |
|
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
Activity: 80
Merit: 11
|
|
October 22, 2013, 01:13:01 PM |
|
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
|
|
October 23, 2013, 08:09:49 PM |
|
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
|
|
October 24, 2013, 02:30:43 PM |
|
This is what I do (python code) and it works (doesn't seem to have ever changed, I never had to change my 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
Activity: 80
Merit: 11
|
|
October 27, 2013, 07:10:37 AM Last edit: October 27, 2013, 07:24:34 AM by alikim |
|
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?
|
|
|
|
|
frito
|
|
December 27, 2013, 07:44:11 PM |
|
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
|
|
December 27, 2013, 08:35:33 PM |
|
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
Activity: 102
Merit: 10
|
|
January 02, 2014, 11:25:14 PM |
|
This is what I do (python code) and it works (doesn't seem to have ever changed, I never had to change my 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
|
|
January 21, 2014, 09:54:26 AM |
|
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. In this case Json.Net is unable to parse the string to decimal by default. To get around this, I currently use this construct: 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.infoSpare 10% mit diesem link. Save 10% on purchases with this link.
|
|
|
prof7bit
|
|
January 21, 2014, 10:16:39 AM |
|
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
|
|
February 18, 2014, 04:44:34 PM |
|
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!
|
|
|
|
|