zhouaini528 / binance-php

Binance API Like the official document interface, Support for arbitrary extension.
MIT License
107 stars 43 forks source link

update endpoints for futures to v2 #25

Closed ItsNash0 closed 3 years ago

ItsNash0 commented 3 years ago

didn't check if there are any new parameters or changes required for V2, just renamed the api endpoints

ItsNash0 commented 3 years ago

added positionRisk endpoint, useful to know without making a slow call to account information to get the data about a position on a certain symbol

zhouaini528 commented 3 years ago

Thank you for your commits

Datalink-Wouter commented 2 years ago

Can you undo this commit please? the V2 endpoint causes 404's on orders queries. Changing this back to v1 solves it. I haven't checked Binance's release notes myself but maybe someone should before changing the endpoint to v2 :D

Also, please let me know if you want me to create a PR.

zhouaini528 commented 2 years ago

Can you undo this commit please? the V2 endpoint causes 404's on orders queries. Changing this back to v1 solves it. I haven't checked Binance's release notes myself but maybe someone should before changing the endpoint to v2 :D

Also, please let me know if you want me to create a PR.

Or I do a version control, the default is V1, v2 can be set by setting.Do you think this is okay?

//You can set special needs
$binance->setOptions([
    //Set the request timeout to 60 seconds by default
    'timeout'=>10,

    //https://github.com/guzzle/guzzle
    'proxy'=>[],

    //https://www.php.net/manual/en/book.curl.php
    'curl'=>[],

    //default is v1
    'version'=>'v2',
]);
Datalink-Wouter commented 2 years ago

ooh yeah, even better

zhouaini528 commented 2 years ago

ooh yeah, even better I have released version 2.2.0, it defaults to v1, you can

$binance->setOptions([
//default is v1
//'version'=>'v2',
]);

@ItsNash0