Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Authorized api gives Missing required header: Timestamp error while placing spot order #147

Open
astr0gator opened this issue Apr 11, 2023 · 0 comments

Comments

@astr0gator
Copy link

astr0gator commented Apr 11, 2023

import gate_api
from gate_api import ApiClient, Configuration, Order, SpotApi

configuration = gate_api.Configuration(
            host = "https://api.gateio.ws/api/v4",
            key = GATE_IO_API_KEY,
            secret = GATE_IO_SECRET
        )
api_client = gate_api.ApiClient(configuration)
api_instance = gate_api.SpotApi(api_client)

    def market_buy_gate_io(cls, symbol):
        currency_pair = symbol + "_" + cls.quote_asset

        order = gate_api.Order(
            amount=str(0.05), side="buy", currency_pair="ETH_USDT"
        )
        executed_trade = api_instance.create_order(order)
        return executed_trade

Produces:

*** gate_api.exceptions.GateApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 11 Apr 2023 10:30:28 GMT', 'Content-Type':
'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'openresty'})
HTTP response body: {"message":"Missing required header: Timestamp","label":"MISSING_REQUIRED_HEADER"}

@astr0gator astr0gator changed the title Missing required header: Timestamp Authorized api gives Missing required header: Timestamp error while placing spot order Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant