예제 #1
0
 public function getBalance()
 {
     $params = ['method' => 'getInfo'];
     $request = new \GuzzleHttp\Psr7\Request('POST', $this->getTradingBaseUri(), ['Content-Type' => 'application/x-www-form-urlencoded'], http_build_query($params));
     $signed = $this->signer->sign($request, $this->key, $this->secret);
     $response = $this->client->send($signed);
     $data = json_decode($response->getBody()->getContents());
     $balance = new AccountBalance();
     foreach ($data->return->funds as $currency => $value) {
         $balance->set($currency, $value);
     }
     return $balance;
 }
 public function testBalanceIsSetWithSetBalance()
 {
     $balance = new AccountBalance();
     $balance->set('foo', 1000);
     $this->assertEquals(1000, $balance->get('foo'));
 }