示例#1
0
 /**
  * Obtain the AddressBalance resource for the given identifier.
  *
  * @deprecated since version 1.2. Use AddressClient.
  * @param string $address
  * @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 AddressBalance
  */
 public static function get($address, $params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($address, 'address');
     ArgumentGetParamsValidator::validate($params, 'params');
     $allowedParams = array();
     $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams);
     $payLoad = "";
     $chainUrlPrefix = self::getChainUrlPrefix($apiContext);
     $json = self::executeCall("{$chainUrlPrefix}/addrs/{$address}/balance" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new AddressBalance();
     $ret->fromJson($json);
     return $ret;
 }