Example #1
0
 /**
  * @param string[] $hexPrivateKeys
  * @param string
  * @param bool $compressed True if the public key should be using compressed format
  * @return PrivateKeyList
  * @throws \BlockCypher\Exception\BlockCypherInvalidPrivateKeyException
  */
 public static function fromHexPrivateKeyArray($hexPrivateKeys, $coinSymbol, $compressed = true)
 {
     ArgumentArrayValidator::validate($hexPrivateKeys, 'hexPrivateKeys');
     CoinSymbolValidator::validate($coinSymbol, 'coinSymbol');
     $privateKeyList = new self($coinSymbol);
     foreach ($hexPrivateKeys as $hexPrivateKey) {
         $privateKey = PrivateKeyManipulator::importPrivateKeyFromHex($hexPrivateKey, $compressed);
         // Add private key indexed by public key
         $privateKeyList->addPrivateKey($privateKey);
     }
     return $privateKeyList;
 }