1 | <?php |
||
10 | class P2shScriptFactory |
||
11 | { |
||
12 | /** |
||
13 | * @var OutputScriptFactory |
||
14 | */ |
||
15 | private $scriptPubKey; |
||
16 | |||
17 | /** |
||
18 | * @var Opcodes |
||
19 | */ |
||
20 | private $opcodes; |
||
21 | |||
22 | /** |
||
23 | * P2shScriptFactory constructor. |
||
24 | * @param OutputScriptFactory $scriptPubKey |
||
25 | * @param Opcodes $opcodes |
||
26 | */ |
||
27 | 42 | public function __construct(OutputScriptFactory $scriptPubKey, Opcodes $opcodes) |
|
32 | |||
33 | /** |
||
34 | * Parse a ScriptInterface into a RedeemScript |
||
35 | * |
||
36 | * @param ScriptInterface $script |
||
37 | * @return P2shScript |
||
38 | */ |
||
39 | public function parse(ScriptInterface $script) |
||
43 | |||
44 | /** |
||
45 | * Create a multisig P2SH Script |
||
46 | * |
||
47 | * @param int $m |
||
48 | * @param array $keys |
||
49 | * @param bool|true $sort |
||
50 | * @return P2shScript |
||
51 | */ |
||
52 | 42 | public function multisig($m, array $keys, $sort = true) |
|
56 | |||
57 | /** |
||
58 | * Create a pay-to-pubkey P2SH Script |
||
59 | * |
||
60 | * @param PublicKeyInterface $publicKey |
||
61 | * @return P2shScript |
||
62 | */ |
||
63 | public function payToPubKey(PublicKeyInterface $publicKey) |
||
67 | |||
68 | /** |
||
69 | * Create a pay-to-pubkey-hash P2SH Script |
||
70 | * |
||
71 | * @param PublicKeyInterface $publicKey |
||
72 | * @return P2shScript |
||
73 | */ |
||
74 | public function payToPubKeyHash(PublicKeyInterface $publicKey) |
||
78 | } |
||
79 |