bybit-php icon indicating copy to clipboard operation
bybit-php copied to clipboard

invalid signature for boolean values

Open martinambrus opened this issue 2 years ago • 1 comments

when you pass a real boolean value into an endpoint which expects one, the resulting signature is incorrect and generates an "error sign!" result from the ByBit API

example:

$bybit->privates()->postPositionSwitchIsolated([
      'symbol' => $symbol,
      'is_isolated' => false,
      'buy_leverage' => $leverage,
      'sell_leverage' => $leverage
    ]);

however, if you pass the boolean value as a string instead, everything works correctly:

$bybit->privates()->postPositionSwitchIsolated([
      'symbol' => $symbol,
      'is_isolated' => 'false',
      'buy_leverage' => $leverage,
      'sell_leverage' => $leverage
    ]);

I think this should be either documented somewhere or fixed, as it took me a while to realize what's going on and why my valid requests come back with an invalid signature error.

martinambrus avatar Jan 30 '23 19:01 martinambrus