bybit-php
bybit-php copied to clipboard
invalid signature for boolean values
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.