zhouaini528/exchanges-php

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

deltarix opened this issue · 2 comments

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;
}`

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.

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