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 InputSignerInterface[] |
||
56 | */ |
||
57 | private $signatureCreator = []; |
||
58 | |||
59 | /** |
||
60 | * TxWitnessSigner constructor. |
||
61 | * @param TransactionInterface $tx |
||
62 | * @param EcAdapterInterface $ecAdapter |
||
63 | */ |
||
64 | 94 | public function __construct(TransactionInterface $tx, EcAdapterInterface $ecAdapter = null) |
|
71 | |||
72 | /** |
||
73 | * @param bool $setting |
||
74 | * @return $this |
||
75 | */ |
||
76 | 2 | public function redeemBitcoinCash($setting) |
|
85 | |||
86 | /** |
||
87 | * @param bool $setting |
||
88 | * @return $this |
||
89 | */ |
||
90 | 28 | public function padUnsignedMultisigs($setting) |
|
99 | |||
100 | /** |
||
101 | * @param bool $setting |
||
102 | * @return $this |
||
103 | */ |
||
104 | 2 | public function tolerateInvalidPublicKey($setting) |
|
113 | |||
114 | /** |
||
115 | * @param int $nIn |
||
116 | * @param PrivateKeyInterface $key |
||
117 | * @param TransactionOutputInterface $txOut |
||
118 | * @param SignData $signData |
||
119 | * @param int $sigHashType |
||
120 | * @return $this |
||
121 | */ |
||
122 | 50 | public function sign($nIn, PrivateKeyInterface $key, TransactionOutputInterface $txOut, SignData $signData = null, $sigHashType = SigHash::ALL) |
|
130 | |||
131 | /** |
||
132 | * @param int $nIn |
||
133 | * @param TransactionOutputInterface $txOut |
||
134 | * @param SignData|null $signData |
||
135 | * @return InputSignerInterface |
||
136 | */ |
||
137 | 94 | public function input($nIn, TransactionOutputInterface $txOut, SignData $signData = null) |
|
155 | |||
156 | /** |
||
157 | * @return TransactionInterface |
||
158 | */ |
||
159 | 80 | public function get() |
|
176 | } |
||
177 |