1 | <?php |
||
18 | class KeyToScriptHelper |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var mixed |
||
23 | */ |
||
24 | private $cache = []; |
||
25 | |||
26 | /** |
||
27 | * @var PublicKeySerializerInterface |
||
28 | */ |
||
29 | private $pubKeySer; |
||
30 | |||
31 | /** |
||
32 | * Slip132PrefixRegistry constructor. |
||
33 | * @param EcAdapterInterface $ecAdapter |
||
34 | */ |
||
35 | 20 | public function __construct(EcAdapterInterface $ecAdapter) |
|
39 | |||
40 | /** |
||
41 | * @param array ...$scriptPaths |
||
42 | * @return string |
||
43 | */ |
||
44 | 4 | private function makeScriptKey(... $scriptPaths) |
|
48 | |||
49 | /** |
||
50 | * @return P2pkhScriptDataFactory |
||
51 | */ |
||
52 | 6 | public function getP2pkhFactory() |
|
60 | |||
61 | /** |
||
62 | * @return P2wpkhScriptDataFactory |
||
63 | */ |
||
64 | 10 | public function getP2wpkhFactory() |
|
72 | |||
73 | /** |
||
74 | * @param KeyToScriptDataFactory $scriptFactory |
||
75 | * @return P2shScriptDecorator |
||
76 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
77 | */ |
||
78 | 4 | public function getP2shFactory(KeyToScriptDataFactory $scriptFactory) |
|
86 | |||
87 | /** |
||
88 | * @param KeyToScriptDataFactory $scriptFactory |
||
89 | * @return P2wshScriptDecorator |
||
90 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
91 | */ |
||
92 | public function getP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
||
100 | |||
101 | /** |
||
102 | * @param KeyToScriptDataFactory $scriptFactory |
||
103 | * @return P2shP2wshScriptDecorator |
||
104 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
105 | */ |
||
106 | public function getP2shP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
||
114 | } |
||
115 |