1 | <?php |
||
19 | class KeyToScriptHelper |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var mixed |
||
24 | */ |
||
25 | private $cache = []; |
||
26 | |||
27 | /** |
||
28 | * @var PublicKeySerializerInterface |
||
29 | */ |
||
30 | private $pubKeySer; |
||
31 | |||
32 | /** |
||
33 | * Slip132PrefixRegistry constructor. |
||
34 | * @param EcAdapterInterface $ecAdapter |
||
35 | */ |
||
36 | 20 | public function __construct(EcAdapterInterface $ecAdapter) |
|
40 | |||
41 | /** |
||
42 | * @param array ...$scriptPaths |
||
43 | * @return string |
||
44 | */ |
||
45 | 4 | private function makeScriptKey(... $scriptPaths) |
|
49 | |||
50 | /** |
||
51 | * @return P2pkhScriptDataFactory |
||
52 | */ |
||
53 | 6 | public function getP2pkhFactory() |
|
61 | |||
62 | /** |
||
63 | * @param int $m |
||
64 | * @param int $n |
||
65 | * @param bool $sortKeys |
||
66 | * @return MultisigScriptDataFactory |
||
67 | */ |
||
68 | public function getMultisigFactory(int $m, int $n, bool $sortKeys) |
||
72 | |||
73 | /** |
||
74 | * @return P2wpkhScriptDataFactory |
||
75 | */ |
||
76 | 10 | public function getP2wpkhFactory() |
|
84 | |||
85 | /** |
||
86 | * @param KeyToScriptDataFactory $scriptFactory |
||
87 | * @return P2shScriptDecorator |
||
88 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
89 | */ |
||
90 | 4 | public function getP2shFactory(KeyToScriptDataFactory $scriptFactory) |
|
98 | |||
99 | /** |
||
100 | * @param KeyToScriptDataFactory $scriptFactory |
||
101 | * @return P2wshScriptDecorator |
||
102 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
103 | */ |
||
104 | public function getP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
||
112 | |||
113 | /** |
||
114 | * @param KeyToScriptDataFactory $scriptFactory |
||
115 | * @return P2shP2wshScriptDecorator |
||
116 | * @throws \BitWasp\Bitcoin\Exceptions\DisallowedScriptDataFactoryException |
||
117 | */ |
||
118 | public function getP2shP2wshFactory(KeyToScriptDataFactory $scriptFactory) |
||
126 | } |
||
127 |