1 | <?php |
||
14 | class OutputScriptFactory |
||
15 | { |
||
16 | /** |
||
17 | * @param PublicKeyInterface $publicKey |
||
18 | * @return ScriptInterface |
||
19 | */ |
||
20 | 1 | public function p2pk(PublicKeyInterface $publicKey) |
|
24 | |||
25 | /** |
||
26 | * @param BufferInterface $pubKeyHash |
||
27 | * @return ScriptInterface |
||
28 | */ |
||
29 | 3 | public function p2pkh(BufferInterface $pubKeyHash) |
|
33 | |||
34 | /** |
||
35 | * @param BufferInterface $scriptHash |
||
36 | * @return ScriptInterface |
||
37 | */ |
||
38 | 21 | public function p2sh(BufferInterface $scriptHash) |
|
42 | |||
43 | /** |
||
44 | * @param BufferInterface $witnessScriptHash |
||
45 | * @return ScriptInterface |
||
46 | */ |
||
47 | 4 | public function p2wsh(BufferInterface $witnessScriptHash) |
|
51 | |||
52 | /** |
||
53 | * @param BufferInterface $witnessKeyHash |
||
54 | * @return ScriptInterface |
||
55 | */ |
||
56 | 2 | public function p2wkh(BufferInterface $witnessKeyHash) |
|
60 | /** |
||
61 | * Create a Pay to pubkey output |
||
62 | * |
||
63 | * @param PublicKeyInterface $publicKey |
||
64 | * @return ScriptInterface |
||
65 | */ |
||
66 | 5 | public function payToPubKey(PublicKeyInterface $publicKey) |
|
70 | |||
71 | /** |
||
72 | * Create a P2PKH output script |
||
73 | * |
||
74 | * @param BufferInterface $pubKeyHash |
||
75 | * @return ScriptInterface |
||
76 | */ |
||
77 | 53 | public function payToPubKeyHash(BufferInterface $pubKeyHash) |
|
85 | |||
86 | /** |
||
87 | /** |
||
88 | * Create a P2SH output script |
||
89 | * |
||
90 | * @param BufferInterface $scriptHash |
||
91 | * @return ScriptInterface |
||
92 | */ |
||
93 | 31 | public function payToScriptHash(BufferInterface $scriptHash) |
|
101 | |||
102 | /** |
||
103 | * @param int $m |
||
104 | * @param PublicKeyInterface[] $keys |
||
105 | * @param bool|true $sort |
||
106 | * @return ScriptInterface |
||
107 | */ |
||
108 | public function multisig($m, array $keys = [], $sort = true) |
||
114 | |||
115 | /** |
||
116 | * @param int $m |
||
117 | * @param BufferInterface[] $keys |
||
118 | * @param bool|true $sort |
||
119 | * @return ScriptInterface |
||
120 | */ |
||
121 | 19 | public function multisigKeyBuffers($m, array $keys = [], $sort = true) |
|
152 | |||
153 | /** |
||
154 | * @param BufferInterface $keyHash |
||
155 | * @return ScriptInterface |
||
156 | */ |
||
157 | 2 | public function witnessKeyHash(BufferInterface $keyHash) |
|
165 | |||
166 | /** |
||
167 | * @param BufferInterface $scriptHash |
||
168 | * @return ScriptInterface |
||
169 | */ |
||
170 | 5 | public function witnessScriptHash(BufferInterface $scriptHash) |
|
178 | |||
179 | /** |
||
180 | * @param BufferInterface $commitment |
||
181 | * @return ScriptInterface |
||
182 | */ |
||
183 | 3 | public function witnessCoinbaseCommitment(BufferInterface $commitment) |
|
194 | } |
||
195 |