Giter VIP home page Giter VIP logo

websocket-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

websocket-api's Issues

New WebSocket SDK

新版 WebSocket SDK 会在近期展开,需要关注 SDK 更新的用户请订阅该 issue 。关闭 gateio/gateapi-python#41

New WebSocket SDK is planned in the near future. Subscribe to this issue if this relates to you.

server.sign接口返回错误

我跑的nodejs的例子程序.
server.sign方法返回报错:
{"error": {"code": 11, "message": "Invalid timestamp."}, "result": null, "id": 973}

key和secret用的我自己的. 请确认一下是否是bug或者是配置问题?

Futures trading w/ leverage doesn't work (via API)

Please help!!
I'm having trouble to trade with leverage on the BTC/USD futures via API (3Commas). The trade does happen but with only 1x leverage.

I'm trying to have 20x leverage on the BTC/USD via API (3Commas) on 50USD worth account.

I had initial inquiry on the live chat and the lady told me i'm from restricted country which I believe she is mistaken because i'm from South Korea, not North Korea. I reached out again for live support and then she told me that it cannot be addressed in live chat but asked me to submit the ticket. Then i submitted the ticket and got response that i should check here.. (very inefficient way to guide people.. )

Just for my purpose, I did try 2x leverage trade on the Web (not via API) manually, and i was able to trade with 2x leverage. So it seems like there is some API related issue..

please let me know how i could potentially solve this issue. thank you.

websocket证书

您好,请问当前websocke服务除JavaScript和Python外连接外,都需要导入证书吗?如果是的话证书对不对外开放?

Time synchronization between webcoket api server and own server

Hello. Tell me if there is a way to achieve time synchronization between the Api server, which subscribes to the Api via webcoket?
There is a request, ping-pong, which, on command, sends the time to my server and receives a response for some time (I assume the time of the server). And what can this give? You can simply measure the time from sending to receiving a request.

Py2 to Py3 Hmac

Hi, I am unable to recreate the same HMAC signature in python3. In python3 you need to pass it a bytes object since str is not supported anymore as an argument for hmac.

Python2 Example:

# -*- coding: utf-8 -*-
import hmac
import hashlib
import base64

def sign(secret, message):
	msg_hash = hmac.new(secret, message, hashlib.sha512)
	msg_hash = msg_hash.digest() 
	msg_hash = base64.b64encode(msg_hash)
	return msg_hash 

Python3 Example:

# -*- coding: utf-8 -*-
import hmac 
import hashlib 
import base64 

def sign(secret, message):
    message = message.encode('utf-8')
    secret = secret.encode('utf-8')
    msg_hash = hmac.new(secret, message, hashlib.sha256)
    msg_hash = msg_hash.digest()
    msg_hash = base64.b64encode(msg_hash)
    return msg_hash

Now if i run

(sign('jafsdljkahsjhafjklsadlfak','1552960209216' ))

The results are different.

Python2:
lFXxSNxoV+wRS0v6sorrFwJGUGkGAUczqMWU869ABmMJwP1+17uqa0YjX8eBZif4kna7P3LAR+gkii/OMauQpg==

Python3:
b'+P5Zday6xpB60/RArWMZmExteHSl6zcz0Dc7NpfddlI='

经常retry 关键retry没有一次是成功的

websocket connection lost, retry to reconnect
error returned: code: 2, message: http get status code err, status : 400, url : http://127.0.0.1:8130/ws_auth, info : {"label":"REQUEST_EXPIRED","message":"gap between request Timestamp and server time exceeds 60"}

error returned: error returned: code: 2, message: http get status code err, status : 400, url : http://127.0.0.1:8130/ws_auth, info : {"label":"REQUEST_EXPIRED","message":"gap between request Timestamp and server time exceeds 60"}

code: 2, message: http get status code err, status : 400, url : http://127.0.0.1:8130/ws_auth, info : {"label":"REQUEST_EXPIRED","message":"gap between request Timestamp and server time exceeds 60"}

kline.query开始时间问题 (kline start time problem)

gate.wsGet(Math.round(Math.random()*1000),'kline.query', ["BTC_USDT", 1, 1516951219, 1800]);

这里start 1和end 1516951219表示什么?

猜测1516951219应该是unix time,单位是,1肯定不是unix时间,那是什么意思?

我如果要得到过去24小时的 1min类型的 kline数据,应该传什么参数?

What do start 1 and 1516951219 mean here ?

I guess 1516951219 should be unix time in seconds (not in milliseconds as is the usual case), but then what does 1 mean ?

Say If I want to get the 1min kline data in the past 24 hours, what start and end values should be used ?

Doing this gets me invalid argument error: ``` gate.wsGet(Math.round(Math.random()*1000),'kline.query', ["BTC_USDT", 1566123086, 1566209456, 60]); ``` where 1566209456 is the time when I wrote this code and 1566123086 is 24hours `ago.`

Update:

我传的第一个参数传错了,用了毫秒,没有用秒

I found I used milliseconds in my own code, not seconds ... , but using 1 as the start time in the example is a little confusing, it is unlikely to mean getting all the kline data since 1970.

Authentication fail.

when i use demo codes python, nodejs for API 4.0 result:
{"error": {"code": 11, "message": "Authentication fail."}, "result": null, "id": 4041}

The algorithm sign params is wrong?
Code python:
def get_sign(secret_key, message):
h = (base64.b64encode(hmac.new(secret_key.encode('utf-8'), message.encode('utf-8'), hashlib.sha512).digest())).decode()

Code nodejs:
function getSign(str) {
return crypto.createHmac('sha512', SECRET).update(str).digest().toString('base64');

request payload does not follow json schema

Hi,

I am sending the following request through the API v4:

{
"time": "1626964798",
"channel": "spot.trades",
"event": "subscribe",
"payload": [
"LTC_USDT"
]
}

I get the following response:
{
"time": 1626965030,
"channel": "",
"event": "",
"error": {"code": 1, "message": "request payload does not follow json schema" },
"result": null
}

(please ignore timestamps, I may have pulled the message from a different try, but same message each time)

Any advice on what I am doing wrong?

现货order.update频道疑问

response:

id Integer orderid
market String market
user Integer user id
ctime Float ctime
mtime Float mtime
price String price
amount String amount
left String left
dealFee String deal fee
orderType Integer order type, 1: limit, 2: market
type Integer type, 1: sell, 2: buy
filledAmount String filled amount
filledTotal String filled total

这个mtime是什么时间,我猜是订单的修改时间,但是我在测试的时候,发现一个订单结束之后,这个时间和系统当前时间差的很大,有几十秒,也有的只有几百毫秒

account 通道订阅 change代表什么含义?

你好,我想通过 websocket 的 account 通道得到我现在的用户信息,希望包括,所有余额、可用余额、冻结等。但是,websocket 的 account 通道只返回两个有用信息,一个是 balance 一个是 change.

其中,balance 我认为这个数据返回的一直是总的所有余额。在 api 中其解释是 balance after changed,我理解为是比价变化之后的总余额。

而,change 我一直没有搞明白是什么意思?请告知我,这个属性代表什么意思,以及,我如何通过 websocket 获得 所有余额、可用余额、冻结等用户信息!谢谢!

how to ensure data consistency when using Depth subscription ?

Depth subscription version 3 : https://www.gate.io/docs/websocket/index.html?javascript#depth-subscription
When subscribing, 'depth.subscribe', ["ETH_USDT", 5, "0.0001"]
The first message comes with a value:
{ "method": "depth.update", "params": [ **_true_**, { asks: [Array], bids: [Array], **_id: 1736394129_** },
Аnd contains the complete specified,in this case "5" ORDERBOOK and id.
But subsequent messages with a value of false do not contain an id.
How can you know for sure that a message has not been lost without comparing the id?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.