MCPcopy Create free account
hub / github.com/sammchardy/python-binance / margin_stream_close

Method margin_stream_close

binance/async_client.py:1452–1464  ·  view source on GitHub ↗
(self, listenKey)

Source from the content-addressed store, hash-verified

1450 margin_stream_keepalive.__doc__ = Client.margin_stream_keepalive.__doc__
1451
1452 async def margin_stream_close(self, listenKey):
1453 warnings.warn(
1454 "DELETE /sapi/v1/userDataStream is deprecated and will be removed on 2026-02-20. "
1455 "Use the WebSocket API subscription method instead (create listenToken via POST /sapi/v1/userListenToken, "
1456 "then subscribe with userDataStream.subscribe.listenToken). "
1457 "The margin_socket() method now uses WebSocket API by default.",
1458 DeprecationWarning,
1459 stacklevel=2
1460 )
1461 params = {"listenKey": listenKey}
1462 return await self._request_margin_api(
1463 "delete", "userDataStream", signed=False, data=params
1464 )
1465
1466 async def margin_create_listen_token(self, symbol: Optional[str] = None, is_isolated: bool = False, validity: Optional[int] = None):
1467 """Create a listenToken for margin account user data stream

Callers

nothing calls this directly

Calls 1

_request_margin_apiMethod · 0.95

Tested by

no test coverage detected