Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Alış Satış emirlerinde hatalar alıyorum #578

Open
enennnn13 opened this issue Jun 13, 2024 · 1 comment
Open

Alış Satış emirlerinde hatalar alıyorum #578

enennnn13 opened this issue Jun 13, 2024 · 1 comment

Comments

@enennnn13
Copy link

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))

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.

@catnug
Copy link

catnug commented Jun 14, 2024

merhaba,

orderMethod eksik body icinde. kolay gelsin,

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants