コード例 #1
0
ファイル: Address.php プロジェクト: toneloc/php-client
 /**
  * Obtain the Address 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 Address
  */
 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}?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new Address();
     $ret->fromJson($json);
     return $ret;
 }
コード例 #2
0
 /**
  * Obtain the Address resource for the given identifier.
  *
  * @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 Address
  */
 public function get($address, $params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($address, 'address');
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array('unspentOnly' => 1, 'includeScript' => 1, 'includeConfidence' => 1, 'before' => 1, 'after' => 1, 'limit' => 1, 'confirmations' => 1, 'confidence' => 1, 'omitWalletAddresses' => 1);
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = $this->getChainUrlPrefix($apiContext);
     $json = $this->executeCall("{$chainUrlPrefix}/addrs/{$address}?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new Address();
     $ret->fromJson($json);
     return $ret;
 }