/**
  * @param  string $url
  * @param  array  $config
  *
  * @return Client
  */
 public function createClient($url = null, array $config = [])
 {
     return Client::factory($url ?: $this->defaultUrl, $config);
 }
Exemple #2
0
 protected function _request($method, $params = [])
 {
     $client = Client::factory($this->buildUrl());
     return $client->send($client->request(123, $method, $params))->getRpcResult();
 }
Exemple #3
0
 public function testStaticFactory()
 {
     $this->assertInstanceOf('Graze\\GuzzleHttp\\JsonRpc\\ClientInterface', Client::factory('http://foo'));
 }
 public function __construct($url)
 {
     $this->client = RpcClient::factory($url);
 }
 public function __construct($url, $user, $pass)
 {
     $this->request_id = time() * 10;
     $this->client = RpcClient::factory($url);
     $this->login($user, $pass);
 }
Exemple #6
0
 /**
  * Wallet constructor.
  * @param string $hostname
  * @param int $port
  */
 function __construct($hostname = 'http://127.0.0.1', $port = 18082)
 {
     $url = $hostname . ':' . $port . '/json_rpc';
     $this->client = Client::factory($url);
 }