1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the "php-ipfs" package. |
7
|
|
|
* |
8
|
|
|
* (c) Robert Schönthal <[email protected]> |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace IPFS\Api; |
15
|
|
|
|
16
|
|
|
use IPFS\Annotation\Api as Endpoint; |
17
|
|
|
use IPFS\Command\Command; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @author Robert Schönthal <[email protected]> |
21
|
|
|
* @autogenerated |
22
|
|
|
* @codeCoverageIgnore |
23
|
|
|
*/ |
24
|
|
|
final class Dag implements Api |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* Get a dag node from ipfs. |
28
|
|
|
* |
29
|
|
|
* @Endpoint(name="dag:get") |
30
|
|
|
* |
31
|
|
|
* @param string $arg the object to get Required: |
32
|
|
|
* |
33
|
|
|
* @return Command |
34
|
|
|
*/ |
35
|
|
|
public function get(string $arg): Command |
36
|
|
|
{ |
37
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Add a dag node to ipfs. |
42
|
|
|
* |
43
|
|
|
* @Endpoint(name="dag:put") |
44
|
|
|
* |
45
|
|
|
* @param string $file the object to put Required: |
46
|
|
|
* @param string $format format that the object will be added as |
47
|
|
|
* @param string $inputEnc format that the input object will be |
48
|
|
|
* @param bool $pin pin this object when adding |
49
|
|
|
* @param string $hash hash function to use |
50
|
|
|
* |
51
|
|
|
* @return Command |
52
|
|
|
*/ |
53
|
|
|
public function put(string $file, string $format = 'cbor', string $inputEnc = 'json', bool $pin = false, string $hash = null): Command |
54
|
|
|
{ |
55
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Resolve ipld block. |
60
|
|
|
* |
61
|
|
|
* @Endpoint(name="dag:resolve") |
62
|
|
|
* |
63
|
|
|
* @param string $arg the path to resolve Required: |
64
|
|
|
* |
65
|
|
|
* @return Command |
66
|
|
|
*/ |
67
|
|
|
public function resolve(string $arg): Command |
68
|
|
|
{ |
69
|
|
|
return new Command(__METHOD__, get_defined_vars()); |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|