@@ -669,6 +669,11 @@ discard block |
||
| 669 | 669 | ]; |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | + /** |
|
| 673 | + * @param integer $bits |
|
| 674 | + * |
|
| 675 | + * @return string |
|
| 676 | + */ |
|
| 672 | 677 | public static function randomBits($bits) { |
| 673 | 678 | return self::randomBytes($bits / 8); |
| 674 | 679 | } |
@@ -965,7 +970,7 @@ discard block |
||
| 965 | 970 | * create wallet using the API |
| 966 | 971 | * |
| 967 | 972 | * @param string $identifier the wallet identifier to create |
| 968 | - * @param array $primaryPublicKey BIP32 extended public key - [key, path] |
|
| 973 | + * @param string[] $primaryPublicKey BIP32 extended public key - [key, path] |
|
| 969 | 974 | * @param string $backupPublicKey plain public key |
| 970 | 975 | * @param string $primaryMnemonic mnemonic to store |
| 971 | 976 | * @param string $checksum checksum to store |
@@ -992,9 +997,9 @@ discard block |
||
| 992 | 997 | * @param string $identifier the wallet identifier to create |
| 993 | 998 | * @param array $primaryPublicKey BIP32 extended public key - [key, path] |
| 994 | 999 | * @param string $backupPublicKey plain public key |
| 995 | - * @param $encryptedPrimarySeed |
|
| 996 | - * @param $encryptedSecret |
|
| 997 | - * @param $recoverySecret |
|
| 1000 | + * @param string|false $encryptedPrimarySeed |
|
| 1001 | + * @param string|false $encryptedSecret |
|
| 1002 | + * @param string|false $recoverySecret |
|
| 998 | 1003 | * @param string $checksum checksum to store |
| 999 | 1004 | * @param int $keyIndex account that we expect to use |
| 1000 | 1005 | * @return mixed |
@@ -1023,8 +1028,8 @@ discard block |
||
| 1023 | 1028 | * @param string $identifier the wallet identifier to create |
| 1024 | 1029 | * @param array $primaryPublicKey BIP32 extended public key - [key, path] |
| 1025 | 1030 | * @param string $backupPublicKey plain public key |
| 1026 | - * @param $encryptedPrimarySeed |
|
| 1027 | - * @param $encryptedSecret |
|
| 1031 | + * @param string|false $encryptedPrimarySeed |
|
| 1032 | + * @param string|false $encryptedSecret |
|
| 1028 | 1033 | * @param $recoverySecret |
| 1029 | 1034 | * @param string $checksum checksum to store |
| 1030 | 1035 | * @param int $keyIndex account that we expect to use |
@@ -1722,7 +1727,7 @@ discard block |
||
| 1722 | 1727 | * convert a Satoshi value to a BTC value |
| 1723 | 1728 | * |
| 1724 | 1729 | * @param int $satoshi |
| 1725 | - * @return float |
|
| 1730 | + * @return string |
|
| 1726 | 1731 | */ |
| 1727 | 1732 | public static function toBTC($satoshi) { |
| 1728 | 1733 | return bcdiv((int)(string)$satoshi, 100000000, 8); |
@@ -1752,7 +1757,7 @@ discard block |
||
| 1752 | 1757 | * convert a BTC value to a Satoshi value |
| 1753 | 1758 | * |
| 1754 | 1759 | * @param float $btc |
| 1755 | - * @return string |
|
| 1760 | + * @return integer |
|
| 1756 | 1761 | */ |
| 1757 | 1762 | public static function toSatoshi($btc) { |
| 1758 | 1763 | return (int)self::toSatoshiString($btc); |
@@ -1761,7 +1766,7 @@ discard block |
||
| 1761 | 1766 | /** |
| 1762 | 1767 | * json_decode helper that throws exceptions when it fails to decode |
| 1763 | 1768 | * |
| 1764 | - * @param $json |
|
| 1769 | + * @param string $json |
|
| 1765 | 1770 | * @param bool $assoc |
| 1766 | 1771 | * @return mixed |
| 1767 | 1772 | * @throws \Exception |
@@ -1813,6 +1818,9 @@ discard block |
||
| 1813 | 1818 | } |
| 1814 | 1819 | } |
| 1815 | 1820 | |
| 1821 | + /** |
|
| 1822 | + * @param BIP32Key[] $keys |
|
| 1823 | + */ |
|
| 1816 | 1824 | public static function normalizeBIP32KeyArray($keys) { |
| 1817 | 1825 | return Util::arrayMapWithIndex(function ($idx, $key) { |
| 1818 | 1826 | return [$idx, self::normalizeBIP32Key($key)]; |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use BitWasp\Bitcoin\MessageSigner\SignedMessage; |
| 16 | 16 | use BitWasp\Bitcoin\Mnemonic\Bip39\Bip39SeedGenerator; |
| 17 | 17 | use BitWasp\Bitcoin\Mnemonic\MnemonicFactory; |
| 18 | -use BitWasp\Bitcoin\Network\NetworkFactory; |
|
| 19 | 18 | use BitWasp\Bitcoin\Network\NetworkInterface; |
| 20 | 19 | use BitWasp\Bitcoin\Transaction\TransactionFactory; |
| 21 | 20 | use BitWasp\Buffertools\Buffer; |