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 InputSignerInterface[] |
||
51 | */ |
||
52 | private $signatureCreator = []; |
||
53 | |||
54 | /** |
||
55 | * TxWitnessSigner constructor. |
||
56 | * @param TransactionInterface $tx |
||
57 | * @param EcAdapterInterface $ecAdapter |
||
58 | */ |
||
59 | 66 | public function __construct(TransactionInterface $tx, EcAdapterInterface $ecAdapter = null) |
|
66 | |||
67 | /** |
||
68 | * @param bool $setting |
||
69 | * @return $this |
||
70 | */ |
||
71 | 2 | public function redeemBitcoinCash($setting) |
|
81 | |||
82 | /** |
||
83 | * @param bool $setting |
||
84 | * @return $this |
||
85 | */ |
||
86 | 2 | public function tolerateInvalidPublicKey($setting) |
|
96 | |||
97 | /** |
||
98 | * @param int $nIn |
||
99 | * @param PrivateKeyInterface $key |
||
100 | * @param TransactionOutputInterface $txOut |
||
101 | * @param SignData $signData |
||
102 | * @param int $sigHashType |
||
103 | * @return $this |
||
104 | */ |
||
105 | 50 | public function sign($nIn, PrivateKeyInterface $key, TransactionOutputInterface $txOut, SignData $signData = null, $sigHashType = SigHash::ALL) |
|
113 | |||
114 | /** |
||
115 | * @param int $nIn |
||
116 | * @param TransactionOutputInterface $txOut |
||
117 | * @param SignData|null $signData |
||
118 | * @return InputSignerInterface |
||
119 | */ |
||
120 | 66 | public function input($nIn, TransactionOutputInterface $txOut, SignData $signData = null) |
|
137 | |||
138 | /** |
||
139 | * @return TransactionInterface |
||
140 | */ |
||
141 | 52 | public function get() |
|
158 | } |
||
159 |