/**
  * @depends testSerializationDeserialization
  * @param HDWalletGenerateAddressResponse $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getToken(), "c0afcccdde5081d6429de37d16166ead");
     $this->assertEquals($obj->getName(), "bob");
     $this->assertEquals($obj->getAddresses(), array("1NwEtFZ6Td7cpKaJtYoeryS6avP2TUkSMh"));
     $this->assertEquals($obj->getHd(), true);
     $this->assertEquals($obj->getSubchainIndex(), 1);
     $this->assertEquals($obj->getAddress(), "1NwEtFZ6Td7cpKaJtYoeryS6avP2TUkSMh");
     $this->assertEquals($obj->getPublic(), "029b393153a1ec68c7af3a98e88aecede3a409f27e698c090540098611c79e05b0");
 }
Example #2
0
 /**
  * A new address is generated similar to Address Generation and associated it with the given wallet.
  *
  * @deprecated since version 1.2. Use HDWalletClient.
  * @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 HDWalletGenerateAddressResponse
  */
 public function generateAddress($params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array('subchain_index' => 1);
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = self::getChainUrlPrefix($apiContext);
     $json = self::executeCall("{$chainUrlPrefix}/wallets/hd/{$this->name}/addresses/generate?" . http_build_query($params), "POST", $payLoad, null, $apiContext, $restCall);
     $ret = new HDWalletGenerateAddressResponse();
     $ret->fromJson($json);
     return $ret;
 }