if response.status_code == 200:
response_data = get_response_json(response)
if response_data is None:
print(f"{order_type.capitalize()} emri sırasında JSON decode hatası: {response.text}")
return None
return response_data
else:
print(f"API isteği başarısız oldu: {order_type.capitalize()} emri, Status Code: {response.status_code}")
return None
def place_sell_order(pair_symbol, quantity, price=None):
endpoint = "/v1/order"
order_data = {
'pairSymbol': pair_symbol,
'quantity': quantity,
'price': price,
'orderType': 'sell'
}
headers = get_headers()
response = requests.post("https://api.btcturk.com/" + endpoint, headers=headers, data=json.dumps(order_data))
bu hatayı alıyorum:
API isteği başarısız oldu: Satış emri, Status Code: 404
ENJUSDT için satış emri verildi: None
hesabımda yeteri kadar enjcoin bulunmasına rağmen.
Merhabalar, şöyleki bu koddan def place_order(order_type, pair_symbol, quantity, price=None): endpoint = "/v1/order" order_data = { 'pairSymbol': pair_symbol, 'quantity': quantity, 'price': price, 'orderType': order_type } headers = get_headers() response = requests.post("https://api.btcturk.com/" + endpoint, headers=headers, data=json.dumps(order_data))
def place_sell_order(pair_symbol, quantity, price=None): endpoint = "/v1/order" order_data = { 'pairSymbol': pair_symbol, 'quantity': quantity, 'price': price, 'orderType': 'sell' } headers = get_headers() response = requests.post("https://api.btcturk.com/" + endpoint, headers=headers, data=json.dumps(order_data)) bu hatayı alıyorum: API isteği başarısız oldu: Satış emri, Status Code: 404 ENJUSDT için satış emri verildi: None hesabımda yeteri kadar enjcoin bulunmasına rağmen.