Module: Binance::Spot::Stream

Included in:
Binance::Spot
Defined in:
lib/binance/spot/stream.rb

Overview

User data stream endpoints

Instance Method Summary collapse

Instance Method Details

#delete_listen_key(listenKey) ⇒ Object

Close a ListenKey (USER_STREAM)

DELETE /api/v3/userDataStream

Parameters:

  • listenKey (String)


29
30
31
# File 'lib/binance/spot/stream.rb', line 29

def delete_listen_key(listenKey)
  @session.limit_request(method: :delete, path: '/api/v3/userDataStream', params: { listenKey: listenKey })
end

#delete_margin_listen_key(listenKey) ⇒ Object

Close a ListenKey (USER_STREAM)

DELETE /sapi/v1/userDataStream

Parameters:

  • listenKey (String)


56
57
58
# File 'lib/binance/spot/stream.rb', line 56

def delete_margin_listen_key(listenKey)
  @session.limit_request(method: :delete, path: '/sapi/v1/userDataStream', params: { listenKey: listenKey })
end

#new_listen_keyObject

Create a ListenKey (USER_STREAM)

POST /api/v3/userDataStream



11
12
13
# File 'lib/binance/spot/stream.rb', line 11

def new_listen_key
  @session.limit_request(method: :post, path: '/api/v3/userDataStream')
end

#new_margin_listen_keyObject

Create a ListenKey (USER_STREAM)

POST /sapi/v1/userDataStream



38
39
40
# File 'lib/binance/spot/stream.rb', line 38

def new_margin_listen_key
  @session.limit_request(method: :post, path: '/sapi/v1/userDataStream')
end

#renew_listen_key(listenKey) ⇒ Object

Ping/Keep-alive a ListenKey (USER_STREAM)

PUT /api/v3/userDataStream

Parameters:

  • listenKey (String)


20
21
22
# File 'lib/binance/spot/stream.rb', line 20

def renew_listen_key(listenKey)
  @session.limit_request(method: :put, path: '/api/v3/userDataStream', params: { listenKey: listenKey })
end

#renew_margin_listen_key(listenKey) ⇒ Object

Ping/Keep-alive a ListenKey (USER_STREAM)

PUT /sapi/v1/userDataStream

Parameters:

  • listenKey (String)


47
48
49
# File 'lib/binance/spot/stream.rb', line 47

def renew_margin_listen_key(listenKey)
  @session.limit_request(method: :put, path: '/sapi/v1/userDataStream', params: { listenKey: listenKey })
end