1 | <?php |
||
23 | class Factory |
||
24 | { |
||
25 | /** |
||
26 | * @var NetworkInterface |
||
27 | */ |
||
28 | private $network; |
||
29 | |||
30 | /** |
||
31 | * @var Random |
||
32 | */ |
||
33 | private $random; |
||
34 | |||
35 | /** |
||
36 | * @param NetworkInterface $network |
||
37 | * @param Random $random |
||
38 | */ |
||
39 | 126 | public function __construct(NetworkInterface $network, Random $random) |
|
44 | |||
45 | /** |
||
46 | * @param int $version |
||
47 | * @param int $services |
||
48 | * @param int $timestamp |
||
49 | * @param NetworkAddressInterface $addrRecv |
||
50 | * @param NetworkAddressInterface $addrFrom |
||
51 | * @param BufferInterface $userAgent |
||
52 | * @param int $startHeight |
||
53 | * @param bool $relay |
||
54 | * @return Version |
||
55 | */ |
||
56 | 51 | public function version( |
|
78 | |||
79 | /** |
||
80 | * @return VerAck |
||
81 | */ |
||
82 | 15 | public function verack() |
|
86 | |||
87 | /** |
||
88 | * @return SendHeaders |
||
89 | */ |
||
90 | 3 | public function sendheaders() |
|
94 | |||
95 | /** |
||
96 | * @param NetworkAddressTimestamp[] $addrs |
||
97 | * @return Addr |
||
98 | */ |
||
99 | 3 | public function addr(array $addrs) |
|
103 | |||
104 | /** |
||
105 | * @param Inventory[] $vectors |
||
106 | * @return Inv |
||
107 | */ |
||
108 | 3 | public function inv(array $vectors) |
|
112 | |||
113 | /** |
||
114 | * @param Inventory[] $vectors |
||
115 | * @return GetData |
||
116 | */ |
||
117 | 3 | public function getdata(array $vectors) |
|
121 | |||
122 | /** |
||
123 | * @param Inventory[] $vectors |
||
124 | * @return NotFound |
||
125 | */ |
||
126 | 3 | public function notfound(array $vectors) |
|
130 | |||
131 | /** |
||
132 | * @param $version |
||
133 | * @param BlockLocator $blockLocator |
||
134 | * @return GetBlocks |
||
135 | */ |
||
136 | 3 | public function getblocks($version, BlockLocator $blockLocator) |
|
140 | |||
141 | /** |
||
142 | * @param $version |
||
143 | * @param BlockLocator $blockLocator |
||
144 | * @return GetHeaders |
||
145 | */ |
||
146 | 3 | public function getheaders($version, BlockLocator $blockLocator) |
|
150 | |||
151 | /** |
||
152 | * @param TransactionInterface $tx |
||
153 | * @return Tx |
||
154 | */ |
||
155 | 3 | public function tx(TransactionInterface $tx) |
|
159 | |||
160 | /** |
||
161 | * @param BlockInterface $block |
||
162 | * @return Block |
||
163 | */ |
||
164 | 3 | public function block(BlockInterface $block) |
|
168 | |||
169 | /** |
||
170 | * @param \BitWasp\Bitcoin\Block\BlockHeaderInterface[] $headers |
||
171 | * @return Headers |
||
172 | */ |
||
173 | 3 | public function headers(array $headers) |
|
177 | |||
178 | /** |
||
179 | * @return GetAddr |
||
180 | */ |
||
181 | 3 | public function getaddr() |
|
185 | |||
186 | /** |
||
187 | * @return MemPool |
||
188 | */ |
||
189 | 3 | public function mempool() |
|
193 | |||
194 | /** |
||
195 | * @param int $feeRate |
||
196 | * @return FeeFilter |
||
197 | */ |
||
198 | 3 | public function feefilter($feeRate) |
|
202 | |||
203 | /** |
||
204 | * @param BufferInterface $data |
||
205 | * @return FilterAdd |
||
206 | */ |
||
207 | 3 | public function filteradd(BufferInterface $data) |
|
211 | |||
212 | /** |
||
213 | * @param BloomFilter $filter |
||
214 | * @return FilterLoad |
||
215 | */ |
||
216 | 3 | public function filterload(BloomFilter $filter) |
|
220 | |||
221 | /** |
||
222 | * @return FilterClear |
||
223 | */ |
||
224 | 3 | public function filterclear() |
|
228 | |||
229 | /** |
||
230 | * @param FilteredBlock $filtered |
||
231 | * @return MerkleBlock |
||
232 | */ |
||
233 | 3 | public function merkleblock(FilteredBlock $filtered) |
|
237 | /** |
||
238 | * @return Ping |
||
239 | * @throws \BitWasp\Bitcoin\Exceptions\RandomBytesFailure |
||
240 | */ |
||
241 | 6 | public function ping() |
|
245 | |||
246 | /** |
||
247 | * @param Ping $ping |
||
248 | * @return Pong |
||
249 | */ |
||
250 | 3 | public function pong(Ping $ping) |
|
254 | |||
255 | /** |
||
256 | * @param BufferInterface $message |
||
257 | * @param int $code |
||
258 | * @param BufferInterface $reason |
||
259 | * @param BufferInterface|null $data |
||
260 | * @return Reject |
||
261 | */ |
||
262 | 9 | public function reject( |
|
279 | |||
280 | /** |
||
281 | * @param AlertDetail $detail |
||
282 | * @param SignatureInterface $sig |
||
283 | * @return Alert |
||
284 | */ |
||
285 | 3 | public function alert(AlertDetail $detail, SignatureInterface $sig) |
|
292 | |||
293 | /** |
||
294 | * @param Parser $parser |
||
295 | * @return NetworkMessage |
||
296 | */ |
||
297 | 36 | public function parse(Parser $parser) |
|
301 | |||
302 | /** |
||
303 | * @return NetworkInterface |
||
304 | */ |
||
305 | 12 | public function getNetwork() |
|
309 | } |
||
310 |