1 | <?php |
||
15 | class OutputScriptFactory |
||
16 | { |
||
17 | /** |
||
18 | * @return OutputClassifier |
||
19 | */ |
||
20 | public function classify() |
||
24 | |||
25 | /** |
||
26 | * @param AddressInterface $address |
||
27 | * @return ScriptInterface |
||
28 | */ |
||
29 | 48 | public function payToAddress(AddressInterface $address) |
|
35 | |||
36 | /** |
||
37 | * Create a Pay to pubkey output |
||
38 | * |
||
39 | * @param PublicKeyInterface $publicKey |
||
40 | * @return ScriptInterface |
||
41 | */ |
||
42 | 15 | public function payToPubKey(PublicKeyInterface $publicKey) |
|
46 | |||
47 | /** |
||
48 | * Create a P2PKH output script |
||
49 | * |
||
50 | * @param PublicKeyInterface $public_key |
||
51 | * @return ScriptInterface |
||
52 | */ |
||
53 | 9 | public function payToPubKeyHash(PublicKeyInterface $public_key) |
|
57 | |||
58 | /** |
||
59 | * Create a P2PKH output script from a hash. |
||
60 | * |
||
61 | * @param BufferInterface $hash |
||
62 | * @return ScriptInterface |
||
63 | */ |
||
64 | 12 | public function payToPubKeyHashFromHash(BufferInterface $hash) |
|
72 | |||
73 | /** |
||
74 | * Create a P2SH output script |
||
75 | * |
||
76 | * @param ScriptInterface $p2shScript |
||
77 | * @return ScriptInterface |
||
78 | */ |
||
79 | 45 | public function payToScriptHash(ScriptInterface $p2shScript) |
|
83 | |||
84 | /** |
||
85 | * Create a P2SH script from a provided hash. |
||
86 | * |
||
87 | * @param BufferInterface $hash |
||
88 | * @return ScriptInterface |
||
89 | */ |
||
90 | public function payToScriptHashFromHash(BufferInterface $hash) |
||
98 | |||
99 | /** |
||
100 | * @param int $m |
||
101 | * @param PublicKeyInterface[] $keys |
||
102 | * @param bool|true $sort |
||
103 | * @return ScriptInterface |
||
104 | */ |
||
105 | 39 | public function multisig($m, array $keys = [], $sort = true) |
|
132 | } |
||
133 |