1 | <?php |
||
11 | class PayToPubKeyHashAddress extends Base58Address |
||
12 | { |
||
13 | /** |
||
14 | * PayToPubKeyHashAddress constructor. |
||
15 | * @param BufferInterface $hash |
||
16 | */ |
||
17 | 66 | public function __construct(BufferInterface $hash) |
|
18 | { |
||
19 | 66 | if ($hash->getSize() !== 20) { |
|
20 | 2 | throw new \RuntimeException("P2PKH address hash should be 20 bytes"); |
|
21 | } |
||
22 | |||
23 | 64 | parent::__construct($hash); |
|
24 | 64 | } |
|
25 | |||
26 | /** |
||
27 | * @param NetworkInterface $network |
||
28 | * @return string |
||
29 | */ |
||
30 | 38 | public function getPrefixByte(NetworkInterface $network = null) |
|
35 | |||
36 | /** |
||
37 | * @return ScriptInterface |
||
38 | */ |
||
39 | 18 | public function getScriptPubKey() |
|
43 | } |
||
44 |