/**
  * @depends testSerializationDeserialization
  * @param WalletGenerateAddressResponse $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getToken(), "c0afcccdde5081d6429de37d16166ead");
     $this->assertEquals($obj->getName(), "alice");
     $this->assertEquals($obj->getAddresses(), array("13cj1QtfW61kQHoqXm3khVRYPJrgQiRM6j", "1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e"));
     $this->assertEquals($obj->getPrivate(), "b86b2843a605a4fc7519b7f2ab4e974bf91084759357226c1cbc22892e783b25");
     $this->assertEquals($obj->getPublic(), "03ce35d82764436764f4eb6ed625e4d36de7897f22373b1ef8959deebf392f10cf");
     $this->assertEquals($obj->getAddress(), "18VAyux27CiWQnmYumZeTKNcaw6opvKRLq");
     $this->assertEquals($obj->getWif(), "L3QCMJkNZARVUAfNKFFMpBUWm8JzkzuQTVYbMpwLYhp44pKuJqGf");
 }
Beispiel #2
0
 /**
  * A new address is generated similar to Address Generation and associated it with the given wallet.
  *
  * @deprecated since version 1.2. Use WalletClient.
  * @param array $params Parameters
  * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
  * @param BlockCypherRestCall $restCall is the Rest Call Service that is used to make rest calls
  * @return WalletGenerateAddressResponse
  */
 public function generateAddress($params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array();
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = self::getChainUrlPrefix($apiContext);
     $json = self::executeCall("{$chainUrlPrefix}/wallets/{$this->name}/addresses/generate?" . http_build_query($params), "POST", $payLoad, null, $apiContext, $restCall);
     $ret = new WalletGenerateAddressResponse();
     $ret->fromJson($json);
     return $ret;
 }