1

I'm developing on a mac and got this weird error

def binance_object_creation():
api_key = 'my api key'
secret = 'my secret no'

binance = ccxt.binance(config={
    'apiKey': api_key,
    'secret': secret,
    'enableRateLimit': True, 
    'options': {
        'defaultType': 'future',  # ←-------------- quotes and 'future'
        "adjustForTimeDifference": True
    }
})

binance.fapiPrivate_post_leverage({
    "symbol": "BTCUSDT",  # convert a unified CCXT symbol to an exchange-specific market id
    # "symbol": "BTCUSDT",  # same thing, note there's no slash in the exchange-specific id
    "leverage": 3,
})

return(binance)

wierd thing about this is that, If I remove fapiPrivate_post_leverage stuff, then, the error doesn't occurs. adjustForTimeDifference: True, is set to prevent timestamp error but failed. What would be the problem?

Taewoo.Lim
  • 211
  • 3
  • 14

1 Answers1

0

The time of your computer is out of sync with Binance's clock. I suggest to run this command to fix your mac's time:

sudo sntp -sS time.apple.com
Carlo Revelli
  • 50
  • 2
  • 5