-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect/subscribe to SpotUserDataStream on Testnet #414
Comments
@tiagosiebler, in #422, we pushed an undo commit for the Did you reimplement |
Not yet, closed automatically by accident so I've reopened it, thanks |
+1 // passing ws client options =
{
beautify: true,
api_key: '---',
api_secret: '---',
wsUrl: 'wss://stream.testnet.binance.vision:9443'
}
// getting this error =
[
'Failed to connect to spot user data',
{
category: 'binance-ws',
error: {
code: -2015,
message: 'Invalid API-key, IP, or permissions for action.',
body: [Object],
headers: [Object [AxiosHeaders]],
requestUrl: 'https://api.binance.com/api/v3/userDataStream',
requestBody: undefined,
requestOptions: [Object]
}
}
] |
Actually i found a way to make it work in testnet , in case anyone else is trying.. Here it is: //
const websocketOptions = {
beautify: true,
api_key: apiKey,
api_secret: apiSecret,
restOptions: {
baseUrl: 'https://testnet.binance.vision',
},
wsUrl: 'wss://stream.testnet.binance.vision:9443' ,
};
this.binanceWs = new WebsocketClient(websocketOptions);
this.binanceWs.subscribeSpotUserDataStream();
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
When I try to connect/subscribe to
SpotUserDataStream
, I get an error message statingInvalid API key, IP, or permissions for action.
(code: 2015).Workaround
I tracked the error,
In the
websocket-client.js
file thesubscribeSpotUserDataStream()
method calls thegetSpotRestClient()
method, which tries to connect to real network instead of testnet.When I added the
baseUrl
option for the spot client to use testnet, the problem was solved. However:baseUrl
is not a defined option in theWSClientConfigurableOptions
The text was updated successfully, but these errors were encountered: