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 | * Create a Pay to pubkey output |
||
31 | * |
||
32 | * @param PublicKeyInterface $publicKey |
||
33 | 30 | * @return ScriptInterface |
|
34 | */ |
||
35 | 30 | public function payToPubKey(PublicKeyInterface $publicKey) |
|
39 | |||
40 | /** |
||
41 | * Create a P2PKH output script |
||
42 | * |
||
43 | * @param BufferInterface $pubKeyHash |
||
44 | 102 | * @return ScriptInterface |
|
45 | */ |
||
46 | 102 | public function payToPubKeyHash(BufferInterface $pubKeyHash) |
|
54 | |||
55 | /** |
||
56 | /** |
||
57 | * Create a P2SH output script |
||
58 | * |
||
59 | * @param BufferInterface $scriptHash |
||
60 | 108 | * @return ScriptInterface |
|
61 | */ |
||
62 | 108 | public function payToScriptHash(BufferInterface $scriptHash) |
|
70 | |||
71 | /** |
||
72 | * @param int $m |
||
73 | * @param PublicKeyInterface[] $keys |
||
74 | * @param bool|true $sort |
||
75 | 72 | * @return ScriptInterface |
|
76 | */ |
||
77 | 72 | public function multisig($m, array $keys = [], $sort = true) |
|
108 | |||
109 | /** |
||
110 | * @param BufferInterface $keyHash |
||
111 | * @return ScriptInterface |
||
112 | */ |
||
113 | public function witnessKeyHash(BufferInterface $keyHash) |
||
121 | |||
122 | /** |
||
123 | * @param BufferInterface $scriptHash |
||
124 | * @return ScriptInterface |
||
125 | */ |
||
126 | public function witnessScriptHash(BufferInterface $scriptHash) |
||
134 | |||
135 | /** |
||
136 | * @param BufferInterface $witnessMerkleRoot |
||
137 | * @return ScriptInterface |
||
138 | */ |
||
139 | public function witnessCoinbaseCommitment(BufferInterface $witnessMerkleRoot) |
||
155 | } |
||
156 |