1 | <?php |
||
16 | class OutputScriptFactory |
||
17 | { |
||
18 | /** |
||
19 | * @param AddressInterface $address |
||
20 | 30 | * @return ScriptInterface |
|
21 | */ |
||
22 | 15 | public function payToAddress(AddressInterface $address) |
|
28 | |||
29 | /** |
||
30 | * @param PublicKeyInterface $publicKey |
||
31 | * @return ScriptInterface |
||
32 | */ |
||
33 | 30 | public function p2pk(PublicKeyInterface $publicKey) |
|
37 | |||
38 | /** |
||
39 | * @param BufferInterface $pubKeyHash |
||
40 | * @return ScriptInterface |
||
41 | */ |
||
42 | public function p2pkh(BufferInterface $pubKeyHash) |
||
46 | 102 | ||
47 | /** |
||
48 | * @param BufferInterface $scriptHash |
||
49 | * @return ScriptInterface |
||
50 | 102 | */ |
|
51 | public function p2sh(BufferInterface $scriptHash) |
||
55 | |||
56 | /** |
||
57 | * @param BufferInterface $witnessScriptHash |
||
58 | * @return ScriptInterface |
||
59 | */ |
||
60 | 108 | public function p2wsh(BufferInterface $witnessScriptHash) |
|
64 | |||
65 | /** |
||
66 | 108 | * @param BufferInterface $witnessKeyHash |
|
67 | * @return ScriptInterface |
||
68 | */ |
||
69 | public function p2wkh(BufferInterface $witnessKeyHash) |
||
73 | /** |
||
74 | * Create a Pay to pubkey output |
||
75 | 72 | * |
|
76 | * @param PublicKeyInterface $publicKey |
||
77 | 72 | * @return ScriptInterface |
|
78 | 72 | */ |
|
79 | public function payToPubKey(PublicKeyInterface $publicKey) |
||
83 | |||
84 | /** |
||
85 | * Create a P2PKH output script |
||
86 | 72 | * |
|
87 | * @param BufferInterface $pubKeyHash |
||
88 | * @return ScriptInterface |
||
89 | */ |
||
90 | 72 | public function payToPubKeyHash(BufferInterface $pubKeyHash) |
|
98 | |||
99 | /** |
||
100 | /** |
||
101 | 72 | * Create a P2SH output script |
|
102 | 36 | * |
|
103 | * @param BufferInterface $scriptHash |
||
104 | 72 | * @return ScriptInterface |
|
105 | */ |
||
106 | public function payToScriptHash(BufferInterface $scriptHash) |
||
114 | |||
115 | /** |
||
116 | * @param int $m |
||
117 | * @param PublicKeyInterface[] $keys |
||
118 | * @param bool|true $sort |
||
119 | * @return ScriptInterface |
||
120 | */ |
||
121 | public function multisig($m, array $keys = [], $sort = true) |
||
152 | |||
153 | /** |
||
154 | * @param BufferInterface $keyHash |
||
155 | * @return ScriptInterface |
||
156 | */ |
||
157 | public function witnessKeyHash(BufferInterface $keyHash) |
||
165 | |||
166 | /** |
||
167 | * @param BufferInterface $scriptHash |
||
168 | * @return ScriptInterface |
||
169 | */ |
||
170 | public function witnessScriptHash(BufferInterface $scriptHash) |
||
178 | |||
179 | /** |
||
180 | * @param BufferInterface $commitment |
||
181 | * @return ScriptInterface |
||
182 | */ |
||
183 | public function witnessCoinbaseCommitment(BufferInterface $commitment) |
||
194 | } |
||
195 |