Binance Testnet user_socket() problem.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reproducing the example with Python 3.10, Binance Python 1.0.10, AsyncClient, and BinanceSocketManager.user_socket() against the testnet API URL. Trace the user_socket task alongside order_market_buy() and get_my_trades(); done means identifying why no balance response is received and documenting a verified correction or limitation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Binance Python: 1.0.10
Python: 3.10
Hello,
I have published this issue also on Binance Developer., but didn't get answer.
My issue:
I don't get response from user_socket and do not know if my code is right.
I use Python Binance and asyncIO for parallel processing.
I’m expecting from my program:
-
sending an order via order_market_buy() (ok and tested via get_my_trades()) -
response from user_socket() after change in balance. (that's not running, I receive nothing)
What's wrong with my code? Do you have any suggestions for my following code?
import asyncio
from binance import AsyncClient, BinanceSocketManager
import os
import datetime
api_key = os.environ.get('binance_api_key_test')
api_secret = os.environ.get('binance_api_secret_test')
async def user_socket(client):
bm = BinanceSocketManager(client)
ts = bm.user_socket()
async with ts as tscm:
while True:
res = await tscm.recv()
print("user socket: ", res)
async def set_order_market_buy(symbol, quantity, client):
await asyncio.sleep(5) # waiting user_socket
await client.order_market_buy(
symbol=symbol,
quantity=quantity)
result = await client.get_my_trades(symbol=symbol, limit=1)
print("last order: ", datetime.datetime.fromtimestamp(result[0]['time']/1000)) # converts trade time in normal date
await client.close_connection()
async def aux():
client = await AsyncClient.create(api_key, api_secret)
client.API_URL = 'https://testnet.binance.vision/api'
user_socket2 = asyncio.create_task(user_socket(client=client))
task_order = asyncio.create_task(set_order_market_buy(symbol='BTCUSDT', quantity=0.001, client=client))
await user_socket2
await task_order
if __name__ == "__main__":
asyncio.run(aux())
- Lingua principale
- Python
- Stelle
- 7.2k
- Fork
- 2.3k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sammchardy/python-binance
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sammchardy/python-binance#1666 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
sammchardy/python-binance#864 ·
-
Would you be interested in trying out picows as a websocket client?Forse di nuovo libera @pcriadoperez l’ha presa 224 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
sammchardy/python-binance#1671 · 2 commenti · 2 assegnatari ·
-
Signature IssueForse di nuovo libera @carlosmiei l’ha presa 224 giorni fa e non c’è nessuna pull request aperta. Aperta
sammchardy/python-binance#1669 · 1 commento · 1 assegnatario ·
-
Binance Testnet DNS Resolution Failure (testnet.binance.vision) Causes “Exchange not connected”Forse di nuovo libera @carlosmiei l’ha presa 244 giorni fa e non c’è nessuna pull request aperta. Aperta
sammchardy/python-binance#1667 · 1 commento · 1 assegnatario ·
Tutte le issue di sammchardy/python-binance
Issue simili
-
Broken links found in docsApertadocs pydanty:is-working
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
pydantic/pydantic-ai#8863 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
run-llama/llama_index#23278 ·
I maintainer di solito rispondono entro 2 giorni
-
documentation from-review-extraction github-actions priority: low severity:nit
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
LearningCircuit/local-deep-research#6946 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
oracle/langchain-oracle#323 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
tenstorrent/tt-metal#58057 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno