1 | <?php |
||
17 | class TxSignerContext |
||
18 | { |
||
19 | /** |
||
20 | * @var \BitWasp\Bitcoin\Script\ScriptInfo\ScriptInfoInterface |
||
21 | */ |
||
22 | private $scriptInfo; |
||
23 | |||
24 | /** |
||
25 | * @var null|ScriptInterface |
||
26 | */ |
||
27 | private $redeemScript; |
||
28 | |||
29 | /** |
||
30 | * @var ScriptInterface |
||
31 | */ |
||
32 | private $prevOutScript; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $prevOutType; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $scriptType; |
||
43 | |||
44 | /** |
||
45 | * @var TransactionSignatureInterface[] |
||
46 | */ |
||
47 | private $signatures = []; |
||
48 | |||
49 | /** |
||
50 | * @var PublicKeyInterface[] |
||
51 | */ |
||
52 | private $publicKeys = []; |
||
53 | |||
54 | /** |
||
55 | * @var EcAdapterInterface |
||
56 | */ |
||
57 | private $ecAdapter; |
||
58 | |||
59 | /** |
||
60 | * TxSignerContext constructor. |
||
61 | * @param EcAdapterInterface $ecAdapter |
||
62 | * @param ScriptInterface $outputScript |
||
63 | * @param ScriptInterface|null $redeemScript |
||
64 | */ |
||
65 | 129 | public function __construct( |
|
86 | |||
87 | /** |
||
88 | * @return ScriptInterface |
||
89 | * @throws \RuntimeException |
||
90 | */ |
||
91 | 36 | public function getRedeemScript() |
|
99 | |||
100 | /** |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | 24 | public function getPrevOutType() |
|
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | 87 | public function getScriptType() |
|
116 | |||
117 | /** |
||
118 | * @return array|\BitWasp\Bitcoin\Crypto\EcAdapter\Key\PublicKeyInterface[] |
||
119 | */ |
||
120 | 87 | public function getPublicKeys() |
|
124 | |||
125 | /** |
||
126 | * @return array |
||
127 | */ |
||
128 | 69 | public function getSignatures() |
|
132 | |||
133 | /** |
||
134 | * @param integer $idx |
||
135 | * @param TransactionSignatureInterface $signature |
||
136 | * @return $this |
||
137 | */ |
||
138 | 81 | public function setSignature($idx, TransactionSignatureInterface $signature = null) |
|
143 | |||
144 | /** |
||
145 | * @param PublicKeyInterface[] $publicKeys |
||
146 | * @return $this |
||
147 | */ |
||
148 | 39 | public function setPublicKeys(array $publicKeys) |
|
149 | { |
||
150 | 39 | $this->publicKeys = $publicKeys; |
|
151 | 39 | return $this; |
|
152 | } |
||
153 | |||
154 | /** |
||
155 | * @param TransactionInterface $tx |
||
156 | * @param int $inputToExtract |
||
157 | * @return $this |
||
158 | */ |
||
159 | 81 | public function extractSigs(TransactionInterface $tx, $inputToExtract) |
|
219 | |||
220 | /** |
||
221 | * @return \BitWasp\Bitcoin\Script\Script |
||
222 | */ |
||
223 | 63 | public function regenerateScript() |
|
228 | |||
229 | /** |
||
230 | * @return int |
||
231 | */ |
||
232 | 48 | public function getRequiredSigCount() |
|
236 | |||
237 | /** |
||
238 | * @return int |
||
239 | */ |
||
240 | 54 | public function getSigCount() |
|
244 | |||
245 | /** |
||
246 | * @return bool |
||
247 | */ |
||
248 | 30 | public function isFullySigned() |
|
253 | } |
||
254 |