Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid signature for boolean values #18

Open
martinambrus opened this issue Jan 30, 2023 · 1 comment
Open

invalid signature for boolean values #18

martinambrus opened this issue Jan 30, 2023 · 1 comment

Comments

@martinambrus
Copy link

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.

@eppenga
Copy link

eppenga commented Jan 4, 2024

I think this has nothing to do with this script, if you lookup the API documentation of ByBit, they are the once who want to have it as a string. BTW, I had the same problem that you had ;)

Check for example: https://bybit-exchange.github.io/docs/v5/order/create-order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants