Binance Futures Testnet Websocket
See original GitHub issueHello, I want to use a websocket for BinanceFutures Testnet. However, I could not establish a connection. The code block is as follows. Where am I making a mistake?
The value of startResult returns false.
var client = new BinanceClient(new Binance.Net.Objects.Spot.BinanceClientOptions
{
FuturesUsdtBaseAddress = "wss://stream.binancefuture.com/",
ApiCredentials = new ApiCredentials(_options.ApiKey, _options.ApiSecret)
});
var startResult = client.FuturesUsdt.UserStream.StartUserStream();
if (!startResult.Success) throw new Exception($"Failed to start user stream: {startResult.Error}");
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
WebSocket URL for user data stream on testnet
The documentation says that the websocket url for the testnet is wss://stream.binancefuture.com . However it seems like it only works for market ...
Read more >Change Log – Binance API Documentation
The base websocket endpoint is changed as wss://stream.binancefuture.com, the old one (wss://testnet.binancefuture.com) is no longer in service.
Read more >How to Test My Functions on Binance Testnet
1. Log in to your Binance testnet account on the Binance Futures Testnet. · 2. Scroll down and click [API Key] and you...
Read more >binance-testnet
An unofficial Python API to use the Binance Websocket API`s (com+testnet, ... com-futures+testnet, com-coin_futures, us, tr, dex/chain+testnet) in a easy, ...
Read more >re-unicorn-binance-websocket-api
An unofficial Python API to use the Binance Websocket API`s (com+testnet, com-margin+testnet, com-isolated_margin+testnet, com-futures+testnet, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh I see what is wrong. You’re passing the websocket address to the Rest api client. The BinanceClient class is used to communicate with the Rest api, the BinanceSocketClient class is used to connect to streams.
When using the BinanceClient to start the user stream (which is the correct thing to do before actually subscribing with the socket client) you should set the base address property in the options to the Rest address of the testnet, not the websocket address.
@JKorf I did what you said yes and it worked. Thank you. 😃)