ccxt: Bibox withdraw apikey error

Dear @kroitor

I’m having an issue with the api implementation for bibox, see details below:

  • OS: Centos 7
  • Programming Language version: PHP 7
  • CCXT version: master
  • Exchange: bibox
  • Method: withdraw

$bibox->withdraw('LTC', 1.0, 'litecoin address', null, array('totp_code' => '123456', 'trade_pwd' => '123456'));

results always in the following error:

{"error":{"code":"3011","msg":"接口不支持apikey请求方式"}}

And of course I’m using the correct totp_code and trading password parameters. All other trading functions (placing orders, cancels, trade history, etc) work fine, so it looks like it has something to do with the signing.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 22 (20 by maintainers)

Most upvoted comments

@kroitor and others: Withdrawals via bibox api are fixed! It suddenly started to work since the end of october. But be careful, it looks like its still buggy. I did multiple withdrawals after each other (with 30 secs delay between them, due to 2fa) to different addresses, but the withdrawals all ended up in the first address. You’re all warned. 😉

Thanks @kroitor for researching this!

And if I see the method suddenly starts working in the future (our bot will notice this 😃 I’ll give an update here.

After checking with Bibox team on telegram, it would appear that their API does support withdrawals. The only thing they answered for now is below but I will dig further. @kroitor

data = {
     cmds: string,   // json object serialization into string
     apikey: string, // your apikey
     sign: string    // sign cmds with your secret
 };
 url = 'https://api.bibox.com/v1/xxx';
 post(url, data); // post request

string after formatting:
"cmds": "[{\"cmd\":\"api/ticker\",\"body\":{\"pair\":\"BIX_BTC\"}}]"
Igor Kroitor, [14.08.18 09:04]
Hi! A question/problem with the API: does transfer/transferOut command work with Bibox API at the moment? Because whatever we try, it will reply with

{"error":{"code":"3011","msg":"接口不支持apikey请求方式"}}

The same code works fine for balances, and other private signed calls, but not with transfer/transferOut.

The body of the request is sent like so:

{"cmds":"[{\"cmd\":\"transfer/transferOut\",\"body\":{\"totp_code\":\"822866\",\"trade_pwd\":\"3nMEzuDJ0CC75KdR\",\"coin_symbol\":\"LTC\",\"amount\":\"1.1\",\"addr\":\"LXA3i9eEAVDbgDqkThCa4D6BUJ3SEULkEr\"}}]","apikey":"cb175692b4659acef20fc95b4cd917b010775bcf","sign":"781f63b29a4c50b318649e19bca9f54b"}

(changed my API key, secret and password in the above output)

So it looks like we are sending the request properly, and it does work with any other command, but not the transfer/transferOut. Can someone sched any light on that?

Here's the same issue in the API repository on GitHub:

https://github.com/Biboxcom/api_reference/issues/12

Bibox, [14.08.18 09:07]
[In reply to Igor Kroitor]
please wait patiently,I will check for you with the technicians

Igor Kroitor, [14.08.18 09:08]
Thanks a lot! Standing by for your reply! )

Igor Kroitor, [14.08.18 09:09]
Also, the docs are not very clear on what should be the value of "addr_remark", for LTC in particular, if your tech team can clarify on that, we would be super-thankful!

Bibox, [14.08.18 09:10]
[In reply to Igor Kroitor]
could you please send the screenshot of the api error?it will helpful to define the problem

Igor Kroitor, [14.08.18 09:13]
[ Photo ]

Bibox, [14.08.18 09:19]
[In reply to Igor Kroitor]
Hello,after checked with the technician ,the API can't support the transfer/transferOut command at present,we will make our docs complete in the near future as your suggestion,thanks for your understanding.

Igor Kroitor, [14.08.18 09:20]
Ok, thx so much for the clarification! Do you, maybe, have any ETA on when it will be working again? I'm sure all users want to know when they will be able to withdraw via your API and use the exchange to its full extent ) Your estimate would be very appreciated )

Bibox, [14.08.18 09:22]
[In reply to Igor Kroitor]
thanks for your understanding and support,the ETA hasn't be determined,but we will complete our docs ASAP :)
screen shot 2018-08-14 at 09 21 21 screen shot 2018-08-14 at 09 21 30 screen shot 2018-08-14 at 09 23 13

@rjruigrok ↑ I guess, case closed? %)

@rjruigrok need to make sure it’s not an error in our implementation first, but I definitely will. Thx for your responsiveness as well!

Thanks! If you need any help, possibly it’s related to bibox api itself, if you suspect this then we can both try to push their support to fix this.

@kroitor see the output below. With the exact snippet, including the date setting. Btw, the script fires 3 api calls in total. First getting all market information, then coin info, then the actual withdraw. Below is output of the last call:

Request:
Array
(
    [0] => POST
    [1] => https://api.bibox.com/v1/transfer
    [2] => Array
        (
            [0] => Content-Type: application/json
        )

    [3] => {"cmds":"[{\"cmd\":\"transfer\\\/transferOut\",\"body\":{\"trade_pwd\":\"............\",\"coin_symbol\":\"LTC\",\"amount\":1,\"addr\":\".........\",\"totp_code\":\"568231\"}}]","apikey":"............","sign":"..............."}
)

Response:
Array
(
    [0] => POST
    [1] => https://api.bibox.com/v1/transfer
    [2] => 200
    [3] => 
    [4] => Array
        (
            [server] => Array
                (
                    [0] => Tengine
                )

            [date] => Array
                (
                    [0] => Mon, 13 Aug 2018 21:31:06 GMT
                )

            [content-type] => Array
                (
                    [0] => application/json; charset=utf-8
                )

            [content-length] => Array
                (
                    [0] => 67
                )

            [connection] => Array
                (
                    [0] => keep-alive
                )

            [access-control-allow-origin] => Array
                (
                    [0] => undefined
                )

            [access-control-allow-methods] => Array
                (
                    [0] => POST, GET, OPTIONS
                )

            [access-control-allow-headers] => Array
                (
                    [0] => Content-Type, Accept, x-access-token, X-Requested-With
                )

            [access-control-max-age] => Array
                (
                    [0] => 172800
                )

            [x-ca-request-id] => Array
                (
                    [0] => 4C30CB98-D78F-4C2C-9027-7ED70F586691
                )

            [x-powered-by] => Array
                (
                    [0] => Express
                )

            [access-control-allow-credentials] => Array
                (
                    [0] => true
                )

            [etag] => Array
                (
                    [0] => W/"43-ZqeOEf4ZLo+6gjGn1D3me1vXNco"
                )

            [vary] => Array
                (
                    [0] => Accept-Encoding
                )

        )

    [5] => {"error":{"code":"3011","msg":"接口不支持apikey请求方式"}}
)
PHP Fatal error:  Uncaught ccxt\ExchangeError: bibox {"error":{"code":"3011","msg":"接口不支持apikey请求方式"}} in /sites/development/subversion-checkout/ccxt/php/bibox.php:699
Stack trace:
#0 /sites/development/subversion-checkout/ccxt/php/Exchange.php(1094): ccxt\bibox->handle_errors('3011', '', 'https://api.bib...', 'POST', Array, '{"error":{"code...')
#1 /sites/development/subversion-checkout/ccxt/php/Exchange.php(939): ccxt\Exchange->fetch('https://api.bib...', 'POST', Array, '{"cmds":"[{\\"cm...')
#2 /sites/development/subversion-checkout/ccxt/php/bibox.php(711): ccxt\Exchange->fetch2('transfer', 'private', 'POST', Array, NULL, NULL)
#3 [internal function]: ccxt\bibox->request('transfer', 'private', 'POST', Array)
#4 /sites/development/subversion-checkout/ccxt/php/Exchange.php(868): call_user_func(Array, 'transfer', 'private', 'POST', Array)
#5 [internal function]: ccxt\Exchange->ccxt\{closure}(Array)
#6 /sites/development/subversion-checkout/ccxt/php/Exchange.php(1962): call_user_func_array(Object(Closure), Arr in /sites/development/subversion-checkout/ccxt/php/bibox.php on line 699

@kroitor Nope, but have 2fa via totp enabled. When i do a withdrawal using the website, I have to enter the trading pwd and authenticator totp code, and then able to do succesful withdrawals

image

I’m going to try your shortest possible snippet now. Brb!

never mind, the addr_remark was added by myself because I called it with an empty string as the param. But even when it’s not there (and thus not in body, verified this), problem persists.