Giter Site home page Giter Site logo

Comments (3)

zhouaini528 avatar zhouaini528 commented on August 17, 2024

Hi i kept getting this error. Synching my comp time didn't help or helped for short time.

To solve this problem i've modified \vendor\linwj\bybit\src\RequestV5.php

There you will find function called nonce() It need to be changed to this:

 protected function nonce() {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_URL, 'https://api.bybit.com/v5/market/time');
            $output = curl_exec($ch);
            curl_close($ch);
	    $data = json_decode($output, true);
            $this->nonce=$data['time'];
    }

Now i always have server time in my request, so this error never appeared ever again.

P.S. hope this will be fixed in further updates.

I didn't find the problem in my tests, is it caused by the inconsistency between your server time and the exchange's server time?

What are the details of the error?

from bybit-php.

VaLLDaR avatar VaLLDaR commented on August 17, 2024

Hi, thanks for you answer.
So if there are no other complainants, i guess this is my local problem. My computer somehow doen't synch time properly. I don't want to fix it, because it is easier to use server time :)
When i used binance php sdk, i've been experiencing the same problem there.
But for binance sdk there already exist function UseServerTime().

from bybit-php.

VaLLDaR avatar VaLLDaR commented on August 17, 2024

Full error response is next:

Array
(
    [retCode] => 10002
    [retMsg] => invalid request, please check your server timestamp or recv_window param. req_timestamp[1710434116927],server_timestamp[1710434114398],recv_window[5000]
    [result] => Array
        (
        )

    [retExtInfo] => Array
        (
        )

    [time] => 1710434114398
)

Appears on $bybit->order()->postCreate() and other which requiers timestamp

from bybit-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.