Comments (3)
I can't reproduce it, the code you posted seems to work for me. Are you sure you're using the same socket client to subscribe as you set the options on? This gives no issues for me:
var bybitSocketClient = new BybitSocketClient(new BybitSocketClientOptions()
{
AutoReconnect = true,
UsdPerpetualStreamsOptions = new BybitSocketApiClientOptions()
{
ApiCredentials = new CryptoExchange.Net.Authentication.ApiCredentials("KEY", "SECRET")
},
InversePerpetualStreamsOptions = new BybitSocketApiClientOptions()
{
ApiCredentials = new CryptoExchange.Net.Authentication.ApiCredentials("KEY", "SECRET")
},
SpotStreamsOptions = new BybitSocketApiClientOptions()
{
ApiCredentials = new CryptoExchange.Net.Authentication.ApiCredentials("KEY", "SECRET")
},
InverseFuturesStreamsOptions = new BybitSocketApiClientOptions()
{
ApiCredentials = new CryptoExchange.Net.Authentication.ApiCredentials("KEY", "SECRET")
},
SocketResponseTimeout = TimeSpan.FromSeconds(10),
SocketSubscriptionsCombineTarget = 2,
OutputOriginalData = true,
LogLevel = Microsoft.Extensions.Logging.LogLevel.Trace,
ApiCredentials = new CryptoExchange.Net.Authentication.ApiCredentials("KEY", "SECRET")
});
var t = await bybitSocketClient.UsdPerpetualStreams.SubscribeToUserTradeUpdatesAsync(data =>
{
Console.WriteLine("data");
});
Note that 1 second ResponseTimout might be a bit short
from bybit.net.
Yes i can confirm that the sameclient is being used also even this reproduces the same error for me:
ApiCredentials apiC = new ApiCredentials(textBox1.Text.Trim(), textBox2.Text.Trim());
bybitSocketClient.ClientOptions.OutputOriginalData = true;
bybitSocketClient.ClientOptions.ApiCredentials = apiC;
t = await bybitSocketClient.UsdPerpetualStreams.SubscribeToUserTradeUpdatesAsync(OrderHandler);
if (t.Success)
{
Log("[INF]", "Trades monitor started");
}
else
{
Log("[ERR]", "Socket Error:" + t.Error.Message);
}
is there anything Im missing?permissions of the api key/seceret maybe?
from bybit.net.
The issue here is that the client options should be set on construction of the client. Setting it after doesn't work correctly.
Setting it like this should work:
var bybitSocketClient = new BybitSocketClient(new Bybit.Net.Objects.BybitSocketClientOptions
{
LogLevel = LogLevel.Trace,
ApiCredentials = ApiCredentials(textBox1.Text.Trim(), textBox2.Text.Trim())
});
from bybit.net.
Related Issues (20)
- Missing feeType on /v5/asset/withdraw/create HOT 3
- Inverse V5 GetPositionsAsync get Object reference not set to an instance of an object HOT 3
- Bybit.Net.Objects.Models.V5.BybitSpotLotSizeFilter does not map value "qtyStep" HOT 1
- Missing isMasterTrader parameter in /v5/account/info endpoint (GetMarginAccountInfoAsync) HOT 1
- SetAccountCollateralCoin HOT 1
- Missing Brocker API in V5 HOT 1
- Bug in Websocket Stream Private Order Data... HOT 1
- septa and bleeding bybit packages HOT 2
- api returning error when no data is present HOT 2
- Multiple constructors accepting all given argument types have been found in type 'Bybit.Net.Clients.BybitRestClient' HOT 2
- V5Api.Trading.GetOrdersAsync does NOT return ExecutedFee HOT 1
- Instruments needs an update HOT 1
- PositionMode type in BybitOrderUpdate after 3.5.0 update HOT 1
- V5Api.Trading.GetPositionsAsync cannot parse json string correctly after 3.5.0 HOT 1
- V5LinearApi.SubscribeToOrderbookUpdatesAsync() - Snapshot data not return HOT 7
- V5Api.Account.GetBalancesAsync(AccountType.Unified) throws error... HOT 5
- Error in AccountUpdate_EventAsync at FundingFee event... HOT 2
- Spelling error in InternalDepositStatus enum identifier HOT 1
- JsonSerializationException in GetLinearInverseSymbolsAsync() HOT 1
- Error sign! after March 8th when placing orders or setting leverage HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bybit.net.