1 | <?php |
||
22 | class Factory |
||
23 | { |
||
24 | /** |
||
25 | * @var NetworkInterface |
||
26 | */ |
||
27 | private $network; |
||
28 | |||
29 | /** |
||
30 | * @var Random |
||
31 | */ |
||
32 | private $random; |
||
33 | |||
34 | /** |
||
35 | * @param NetworkInterface $network |
||
36 | * @param Random $random |
||
37 | */ |
||
38 | 99 | public function __construct(NetworkInterface $network, Random $random) |
|
43 | |||
44 | /** |
||
45 | * @param int $version |
||
46 | * @param Buffer $services |
||
47 | * @param int $timestamp |
||
48 | * @param NetworkAddressInterface $addrRecv |
||
49 | * @param NetworkAddressInterface $addrFrom |
||
50 | * @param Buffer $userAgent |
||
51 | * @param int $startHeight |
||
52 | * @param bool $relay |
||
53 | * @return Version |
||
54 | */ |
||
55 | 24 | public function version( |
|
77 | |||
78 | /** |
||
79 | * @return VerAck |
||
80 | */ |
||
81 | 18 | public function verack() |
|
85 | |||
86 | /** |
||
87 | * @return SendHeaders |
||
88 | */ |
||
89 | public function sendheaders() |
||
93 | |||
94 | /** |
||
95 | * @param NetworkAddressTimestamp[] $addrs |
||
96 | * @return Addr |
||
97 | */ |
||
98 | public function addr(array $addrs) |
||
102 | |||
103 | /** |
||
104 | * @param Inventory[] $vectors |
||
105 | * @return Inv |
||
106 | */ |
||
107 | public function inv(array $vectors) |
||
111 | |||
112 | /** |
||
113 | * @param Inventory[] $vectors |
||
114 | * @return GetData |
||
115 | */ |
||
116 | public function getdata(array $vectors) |
||
120 | |||
121 | /** |
||
122 | * @param Inventory[] $vectors |
||
123 | * @return NotFound |
||
124 | */ |
||
125 | public function notfound(array $vectors) |
||
129 | 3 | ||
130 | /** |
||
131 | * @param $version |
||
132 | * @param BlockLocator $blockLocator |
||
133 | * @return GetBlocks |
||
134 | */ |
||
135 | public function getblocks($version, BlockLocator $blockLocator) |
||
139 | 3 | ||
140 | /** |
||
141 | * @param $version |
||
142 | * @param BlockLocator $blockLocator |
||
143 | * @return GetHeaders |
||
144 | */ |
||
145 | public function getheaders($version, BlockLocator $blockLocator) |
||
149 | |||
150 | /** |
||
151 | * @param TransactionInterface $tx |
||
152 | * @return Tx |
||
153 | */ |
||
154 | public function tx(TransactionInterface $tx) |
||
158 | |||
159 | /** |
||
160 | * @param BlockInterface $block |
||
161 | * @return Block |
||
162 | */ |
||
163 | public function block(BlockInterface $block) |
||
167 | |||
168 | /** |
||
169 | * @param \BitWasp\Bitcoin\Block\BlockHeaderInterface[] $headers |
||
170 | * @return Headers |
||
171 | */ |
||
172 | 3 | public function headers(array $headers) |
|
176 | |||
177 | /** |
||
178 | * @return GetAddr |
||
179 | */ |
||
180 | 3 | public function getaddr() |
|
184 | |||
185 | /** |
||
186 | * @return MemPool |
||
187 | */ |
||
188 | public function mempool() |
||
192 | |||
193 | /** |
||
194 | * @param Buffer $data |
||
195 | * @return FilterAdd |
||
196 | */ |
||
197 | public function filteradd(Buffer $data) |
||
201 | |||
202 | /** |
||
203 | * @param BloomFilter $filter |
||
204 | * @return FilterLoad |
||
205 | */ |
||
206 | 3 | public function filterload(BloomFilter $filter) |
|
210 | |||
211 | /** |
||
212 | * @return FilterClear |
||
213 | */ |
||
214 | public function filterclear() |
||
218 | |||
219 | /** |
||
220 | * @param FilteredBlock $filtered |
||
221 | * @return MerkleBlock |
||
222 | */ |
||
223 | 6 | public function merkleblock(FilteredBlock $filtered) |
|
227 | /** |
||
228 | * @return Ping |
||
229 | * @throws \BitWasp\Bitcoin\Exceptions\RandomBytesFailure |
||
230 | */ |
||
231 | public function ping() |
||
235 | |||
236 | /** |
||
237 | * @param Ping $ping |
||
238 | * @return Pong |
||
239 | */ |
||
240 | public function pong(Ping $ping) |
||
244 | 6 | ||
245 | /** |
||
246 | * @param Buffer $message |
||
247 | * @param int $code |
||
248 | * @param Buffer $reason |
||
249 | * @param Buffer|null $data |
||
250 | 6 | * @return Reject |
|
251 | */ |
||
252 | public function reject( |
||
269 | 3 | ||
270 | 3 | /** |
|
271 | * @param AlertDetail $detail |
||
272 | 3 | * @param SignatureInterface $sig |
|
273 | * @return Alert |
||
274 | */ |
||
275 | public function alert(AlertDetail $detail, SignatureInterface $sig) |
||
282 | |||
283 | /** |
||
284 | * @param Parser $parser |
||
285 | * @return NetworkMessage |
||
286 | */ |
||
287 | public function parse(Parser & $parser) |
||
291 | } |
||
292 |