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

How to extend binance user class for example with sub-account api calls? #21

Open
deltarix opened this issue Nov 6, 2021 · 2 comments

Comments

@deltarix
Copy link

deltarix commented Nov 6, 2021

How do this work with Exchanges class?
have you a little code snip for request "GET /sapi/v1/sub-account/list (HMAC SHA256)" for me?

my code until now:

`use Lin\Exchange\Exchanges;

try {

$tmp_arr = array();
if (isset($cfg_main_arr['msa_api']['binance']['key_ro'])) {
    $tmp_arr = $cfg_main_arr['msa_api']['binance']['key_ro'];
}
if (empty($tmp_arr)) {
    die('config.json error: binance api key "key_ro" not exists!');
}

$ex_binance = new Exchanges('binance', $tmp_arr['APIKEY'], $tmp_arr['APISECRET']);

$result = $ex_binance->getPlatform('spot')
    ->user()
    ->getAccount();

print_r($result);

} catch (Exception $e) {
// error mail senden!!!
echo $e;
}`

@zhouaini528
Copy link
Owner

https://github.com/zhouaini528/binance-php/blob/master/tests/spot/user.php#L51

The exchange is not perfect, you use the lowest level method to obtain.

@deltarix
Copy link
Author

deltarix commented Nov 6, 2021

have you a little example? w/o changing your code?

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