/** * Obtain multiple FullAddress resources for the given identifiers. * * @deprecated since version 1.2. Use AddressClient. * @param string[] $array * @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 getMultiple($array, $params = array(), $apiContext = null, $restCall = null) { ArgumentArrayValidator::validate($array, 'array'); ArgumentGetParamsValidator::validate($params, 'params'); $allowedParams = array('unspentOnly' => 1, 'before' => 1); $params = ArgumentGetParamsValidator::sanitize($params, $allowedParams); $addressList = implode(";", $array); $payLoad = ""; $chainUrlPrefix = self::getChainUrlPrefix($apiContext); $json = self::executeCall("{$chainUrlPrefix}/addrs/{$addressList}/full?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall); return FullAddress::getList($json); }
/** * @return FullAddress[] */ public function testGetMultiple() { $request = $this->operation['response']['body']; $fullAddressArray = FullAddress::getList($request); $fullAddressList = array(); /** @var FullAddress $fullAddress */ foreach ($fullAddressArray as $fullAddress) { $fullAddressList[] = $fullAddress->getAddress(); } $result = FullAddress::getMultiple($fullAddressList, array(), $this->apiContext, $this->mockBlockCypherRestCall); $this->assertNotNull($result); $this->assertContainsOnlyInstancesOf('\\BlockCypher\\Api\\FullAddress', $result); $this->assertEquals(count($result), count($fullAddressList)); foreach ($result as $fullAddr) { $this->assertContains($fullAddr->getAddress(), $fullAddressList); } return $result; }
/** * Obtain multiple FullAddress resources for the given identifiers. * * @param string[] $array * @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 getMultipleFullAddresses($array, $params = array(), $apiContext = null, $restCall = null) { ArgumentArrayValidator::validate($array, 'array'); 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); $addressList = implode(";", $array); $payLoad = ""; $chainUrlPrefix = $this->getChainUrlPrefix($apiContext); $json = $this->executeCall("{$chainUrlPrefix}/addrs/{$addressList}/full?" . http_build_query($params), "GET", $payLoad, null, $apiContext, $restCall); return FullAddress::getList($json); }