【问题标题】:"Timestamp ahead 1000ms" error on binance api?binance api上的“时间戳提前1000毫秒”错误?
【发布时间】:2021-06-19 05:13:21
【问题描述】:

我在 mac 上开发,遇到了这个奇怪的错误

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)

关于这件事的奇怪之处在于,如果我删除 fapiPrivate_post_leverage 的东西,那么就不会发生错误。 adjustForTimeDifference:True,设置为防止时间戳错误但失败。 会有什么问题?

【问题讨论】:

    标签: python binance ccxt


    【解决方案1】:

    您计算机的时间与币安的时钟不同步。我建议运行这个命令来修复你的 mac 时间:

    sudo sntp -sS time.apple.com
    

    【讨论】:

      猜你喜欢
      • 2022-06-27
      • 2016-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-21
      相关资源
      最近更新 更多