-
Notifications
You must be signed in to change notification settings - Fork 495
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
futures #342
base: master
Are you sure you want to change the base?
futures #342
Conversation
hi, thanks for the work. thanks |
I am still editing and adding futures for other functions. I will check out merge conflicts |
php-binance-api.php
Outdated
@@ -240,9 +243,9 @@ protected function setupProxyConfigFromFile(string $file = null) | |||
* @param $flags array addtional options for order type | |||
* @return array with error message or the order details | |||
*/ | |||
public function buy(string $symbol, $quantity, $price, string $type = "LIMIT", array $flags = []) | |||
public function buy(string $symbol, $quantity, $price, string $type = "LIMIT", array $flags = [], $futures = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use a new class FAPI
or FuturesAPI
than to do this with switches. Otherwise, if Margin API is introduced, do you want to be switching Margin and Futures on and off?
php-binance-api.php
Outdated
{ | ||
return $this->order("BUY", $symbol, $quantity, $price, $type, $flags); | ||
return $this->order("BUY", $symbol, $quantity, $price, $type, $flags, false, $futures); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at least use the $flags
array to set 'fapi' => true
and send it to the third parameter of httpRequest()
like it's done with wapi
and sapi
already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more for a separate class or at least separate functions like fBuy and/or fHttpRequest or whatever would fit best. Having the wapi and sapi is according to me already more then enough in httpRequest... (personal view!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, SAPI could be a separate class as well to make it cleaner. WAPI is deprecated as of today: https://www.binance.com/en/support/announcement/f45dde7da58b473aa885349946bed269
I added FAPI class where all functions are the same but they are linked to futures endpoints. There is change in userData stream where you can add function which can be runner on connection to the WebSocket. You can review it now |
Can you please rebase? |
I haven't used it before. I don't know if that should happen. Command: git rebase |
You need to rebase onto jaggedsoft:master. You're likely doing the default where it's your fork's master. |
I rebased. Anything else to do? |
Hello @AlexVanchov, Did you implement a getPositions function? I could not find it in changes. |
did you push the changes to the merge request.. still tell me here there are maege conflicts This branch cannot be rebased due to conflicts |
I would love to see this merge. can you please rebase, squash and push the commits? |
It still have some bugs with futures for some functions. I will pull request again when it's ready |
any update here? |
No description provided.