Beispiel #1
0
 /**
  * Obtain the FullAddress resource for the given identifier.
  *
  * @deprecated since version 1.2. Use AddressClient.
  * @param string $address
  * @param array $params Parameters. Options: unspentOnly, and before
  * @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 FullAddress
  */
 public static function get($address, $params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($address, 'address');
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array('unspentOnly' => 1, 'before' => 1);
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = self::getChainUrlPrefix($apiContext);
     $json = self::executeCall("{$chainUrlPrefix}/addrs/{$address}/full?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new FullAddress();
     $ret->fromJson($json);
     return $ret;
 }
 /**
  * Obtain the FullAddress resource for the given address.
  *
  * @param string $address
  * @param array $params Parameters. Options: unspentOnly, and before
  * @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 FullAddress
  */
 public function getFullAddress($address, $params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($address, 'address');
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array('unspentOnly' => 1, 'before' => 1, 'after' => 1, 'limit' => 1, 'txlimit' => 1, 'confirmations' => 1, 'confidence' => 1, 'includeHex' => 1, 'includeConfidence' => 1, 'omitWalletAddresses' => 1);
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = $this->getChainUrlPrefix($apiContext);
     $json = $this->executeCall("{$chainUrlPrefix}/addrs/{$address}/full?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new FullAddress();
     $ret->fromJson($json);
     return $ret;
 }