You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Websocket için api anahtar yetkilendirmesi ile bağlantı sağlayamıyorum, api anahtarsız örneğin orderbook verilerini alıyorum ancak yetki işin içine girince olmuyor.
nonce = "3000" sabit tanımladım dün çalışıyordu ancak bugün çalışmıyor, yardımınızı rica ederim
Merhaba,
Websocket için api anahtar yetkilendirmesi ile bağlantı sağlayamıyorum, api anahtarsız örneğin orderbook verilerini alıyorum ancak yetki işin içine girince olmuyor.
nonce = "3000" sabit tanımladım dün çalışıyordu ancak bugün çalışmıyor, yardımınızı rica ederim
import asyncio
import base64
import hashlib
import hmac
import json
import time
import websockets
import nest_asyncio
nest_asyncio.apply()
class InterfaceWS:
def init(self, publicKey, privateKey, uri="wss://ws-feed-pro.btcturk.com/"):
self.publicKey = publicKey
self.privateKey = privateKey # Private key base64 formatında olmalıdır.
self.uri = uri
self.ws = None
async def main():
publicKey = "aaaaaaaaaa"
privateKey = "bbbbbbbbb"
asyncio.run(main())
Testing Scenario 1
WebSocket connection established
Auth message being sent (scenario 1):
[
114,
{
"type": 114,
"publicKey": "71588e61-f6dc-4a19-bc99-18e778cc945a",
"signature": "+KjFcqwqucn9Fma6lpf2Nreh8w+m+/0ns8lR8kgSxdk=",
"nonce": "3344000",
"timestamp": "1739513468879"
}
]
Received auth response message:
[
991,
{
"type": 991,
"current": "6.0.0",
"min": "2.3.0"
}
]
Received informational message, waiting for actual login result...
Received auth response message:
[
114,
{
"type": 114,
"id": 0,
"ok": false,
"message": "Unauthorized - Invalid Request"
}
]
❌ Authentication failed for scenario 1, response: [114, {'type': 114, 'id': 0, 'ok': False, 'message': 'Unauthorized - Invalid Request'}]
❌ Scenario 1 authentication failed!
Testing Scenario 2
WebSocket connection established
Auth message being sent (scenario 2):
[
114,
{
"type": 114,
"publicKey": "71588e61-f6dc-4a19-bc99-18e778cc945a",
"signature": "ITBm5Rtaamy5NMjqIWUsoFg7BqQ7RQSG/wctVKbsi1Y=",
"nonce": "1739513469520",
"timestamp": "1739513469520"
}
]
Received auth response message:
[
991,
{
"type": 991,
"current": "6.0.0",
"min": "2.3.0"
}
]
Received informational message, waiting for actual login result...
Received auth response message:
[
114,
{
"type": 114,
"id": 0,
"ok": false,
"message": "Unauthorized - Invalid Request"
}
]
❌ Authentication failed for scenario 2, response: [114, {'type': 114, 'id': 0, 'ok': False, 'message': 'Unauthorized - Invalid Request'}]
❌ Scenario 2 authentication failed!
Testing Scenario 3
WebSocket connection established
Auth message being sent (scenario 3):
[
114,
{
"type": 114,
"publicKey": "71588e61-f6dc-4a19-bc99-18e778cc945a",
"signature": "r5YpotLJ20vs7zFDfuTMc1yFwtvSaxMex5a3cfUr5LE=",
"nonce": "1739513470190",
"timestamp": "1739513470190"
}
]
Received auth response message:
[
991,
{
"type": 991,
"current": "6.0.0",
"min": "2.3.0"
}
]
Received informational message, waiting for actual login result...
Received auth response message:
[
114,
{
"type": 114,
"id": 0,
"ok": false,
"message": "Unauthorized - Invalid Request"
}
]
❌ Authentication failed for scenario 3, response: [114, {'type': 114, 'id': 0, 'ok': False, 'message': 'Unauthorized - Invalid Request'}]
❌ Scenario 3 authentication failed!
Testing Scenario 4
WebSocket connection established
Auth message being sent (scenario 4):
[
114,
{
"type": 114,
"publicKey": "71588e61-f6dc-4a19-bc99-18e778cc945a",
"signature": "gtnFPkrHJV3qA881IV8VPeAjXYUWhswgg7pypHi3cwk=",
"nonce": 1739513470905,
"timestamp": 1739513470905
}
]
Received auth response message:
[
991,
{
"type": 991,
"current": "6.0.0",
"min": "2.3.0"
}
]
Received informational message, waiting for actual login result...
Received auth response message:
[
114,
{
"type": 114,
"id": 0,
"ok": false,
"message": "Unauthorized - Invalid Request"
}
]
❌ Authentication failed for scenario 4, response: [114, {'type': 114, 'id': 0, 'ok': False, 'message': 'Unauthorized - Invalid Request'}]
❌ Scenario 4 authentication failed!
The text was updated successfully, but these errors were encountered: