I am trying to test my program on my testnet account before I deploy it on to my real account.
I created an account and got the API keys from https://testnet.binancefuture.com/en/futures/BTCUSDT
However I am confused as to how I place an order on the testnet.
client = Client(api_key, secret_key)
client.futures_create_order(symbol='BTCUSDT', type=ORDER_TYPE_MARKET, side=SIDE_BUY, quantity=1)
leads to :
binance.exceptions.BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action, request ip: 79.233.206.*** (censored for security reasons)
client = Client(api_key, secret_key)
client.create_test_order(symbol='BTCUSDT', type=ORDER_TYPE_MARKET, side=SIDE_BUY, quantity=1)
leads to:
binance.exceptions.BinanceAPIException: APIError(code=-2015): Invalid API-key, IP, or permissions for action.
you need to check if the Client class supporting testnet, maybe it has parameter to change the base url to testnet. Please check the library source code.