1 | <?php |
||
17 | class Signer |
||
18 | { |
||
19 | /** |
||
20 | * @var EcAdapterInterface |
||
21 | */ |
||
22 | private $ecAdapter; |
||
23 | |||
24 | /** |
||
25 | * @var TransactionInterface |
||
26 | */ |
||
27 | private $tx; |
||
28 | |||
29 | /** |
||
30 | * @var TransactionSignatureSerializer |
||
31 | */ |
||
32 | private $sigSerializer; |
||
33 | |||
34 | /** |
||
35 | * @var PublicKeySerializerInterface |
||
36 | */ |
||
37 | private $pubKeySerializer; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $tolerateInvalidPublicKey = false; |
||
43 | |||
44 | /** |
||
45 | * @var bool |
||
46 | */ |
||
47 | private $redeemBitcoinCash = false; |
||
48 | |||
49 | /** |
||
50 | * @var bool |
||
51 | */ |
||
52 | private $padUnsignedMultisigs = false; |
||
53 | |||
54 | /** |
||
55 | * @var bool |
||
56 | */ |
||
57 | private $allowComplexScripts = false; |
||
58 | |||
59 | /** |
||
60 | * @var InputSignerInterface[] |
||
61 | */ |
||
62 | private $signatureCreator = []; |
||
63 | |||
64 | /** |
||
65 | * TxWitnessSigner constructor. |
||
66 | * @param TransactionInterface $tx |
||
67 | * @param EcAdapterInterface $ecAdapter |
||
68 | */ |
||
69 | 130 | public function __construct(TransactionInterface $tx, EcAdapterInterface $ecAdapter = null) |
|
76 | |||
77 | /** |
||
78 | * @param bool $setting |
||
79 | * @return $this |
||
80 | */ |
||
81 | 2 | public function redeemBitcoinCash($setting) |
|
90 | |||
91 | /** |
||
92 | * @param bool $setting |
||
93 | * @return $this |
||
94 | */ |
||
95 | 28 | public function padUnsignedMultisigs($setting) |
|
104 | |||
105 | /** |
||
106 | * @param bool $setting |
||
107 | * @return $this |
||
108 | */ |
||
109 | 2 | public function tolerateInvalidPublicKey($setting) |
|
118 | |||
119 | /** |
||
120 | * @param bool $setting |
||
121 | * @return $this |
||
122 | */ |
||
123 | 36 | public function allowComplexScripts($setting) |
|
133 | |||
134 | /** |
||
135 | * @param int $nIn |
||
136 | * @param PrivateKeyInterface $key |
||
137 | * @param TransactionOutputInterface $txOut |
||
138 | * @param SignData $signData |
||
139 | * @param int $sigHashType |
||
140 | * @return $this |
||
141 | */ |
||
142 | 50 | public function sign($nIn, PrivateKeyInterface $key, TransactionOutputInterface $txOut, SignData $signData = null, $sigHashType = SigHash::ALL) |
|
152 | |||
153 | /** |
||
154 | * @param int $nIn |
||
155 | * @param TransactionOutputInterface $txOut |
||
156 | * @param SignData|null $signData |
||
157 | * @return InputSignerInterface |
||
158 | */ |
||
159 | 130 | public function input($nIn, TransactionOutputInterface $txOut, SignData $signData = null) |
|
178 | |||
179 | /** |
||
180 | * @return TransactionInterface |
||
181 | */ |
||
182 | 116 | public function get() |
|
199 | } |
||
200 |