1 | <?php |
||
16 | class KeyToScriptHelper |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var mixed |
||
21 | */ |
||
22 | private $cache = []; |
||
23 | |||
24 | /** |
||
25 | * @var PublicKeySerializerInterface |
||
26 | */ |
||
27 | private $pubKeySer; |
||
28 | |||
29 | /** |
||
30 | * Slip132PrefixRegistry constructor. |
||
31 | * @param EcAdapterInterface $ecAdapter |
||
32 | */ |
||
33 | 23 | public function __construct(EcAdapterInterface $ecAdapter) |
|
37 | |||
38 | /** |
||
39 | * @param array ...$scriptPaths |
||
40 | * @return string |
||
41 | */ |
||
42 | 11 | private function makeScriptKey(... $scriptPaths) |
|
46 | |||
47 | /** |
||
48 | * @return P2pkhScriptDataFactory |
||
49 | */ |
||
50 | 12 | public function getP2pkhFactory() |
|
58 | |||
59 | /** |
||
60 | * @return P2wpkhScriptDataFactory |
||
61 | */ |
||
62 | 11 | public function getP2wpkhFactory() |
|
70 | |||
71 | /** |
||
72 | * @param KeyToScriptDataFactory $scriptFactory |
||
73 | * @return P2shScriptDecorator |
||
74 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
75 | */ |
||
76 | 7 | public function getP2shFactory(KeyToScriptDataFactory $scriptFactory) |
|
84 | |||
85 | /** |
||
86 | * @param KeyToScriptDataFactory $scriptFactory |
||
87 | * @return P2wshScriptDecorator |
||
88 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
89 | */ |
||
90 | 2 | public function getP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
|
98 | |||
99 | /** |
||
100 | * @param KeyToScriptDataFactory $scriptFactory |
||
101 | * @return P2shP2wshScriptDecorator |
||
102 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
103 | */ |
||
104 | 2 | public function getP2shP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
|
112 | } |
||
113 |