1
- using Common . Logging ;
1
+ using Ipfs . CoreApi ;
2
2
using Newtonsoft . Json ;
3
3
using Newtonsoft . Json . Linq ;
4
- using System ;
5
- using System . Collections . Generic ;
4
+ using System . Globalization ;
6
5
using System . IO ;
7
- using System . Linq ;
8
6
using System . Text ;
9
7
using System . Threading ;
10
8
using System . Threading . Tasks ;
11
- using Ipfs . CoreApi ;
12
- using System . Globalization ;
13
9
14
10
namespace Ipfs . Http
15
11
{
16
-
17
12
class DagApi : IDagApi
18
13
{
19
- IpfsClient ipfs ;
14
+ private IpfsClient ipfs ;
20
15
21
16
internal DagApi ( IpfsClient ipfs )
22
17
{
23
18
this . ipfs = ipfs ;
24
19
}
25
20
26
-
27
21
public async Task < Cid > PutAsync (
28
22
JObject data ,
29
23
string contentType = "dag-cbor" ,
@@ -49,11 +43,11 @@ public async Task<Cid> PutAsync(
49
43
}
50
44
51
45
public async Task < Cid > PutAsync (
52
- object data ,
46
+ object data ,
53
47
string contentType = "dag-cbor" ,
54
48
string multiHash = MultiHash . DefaultAlgorithmName ,
55
49
string encoding = MultiBase . DefaultAlgorithmName ,
56
- bool pin = true ,
50
+ bool pin = true ,
57
51
CancellationToken cancel = default ( CancellationToken ) )
58
52
{
59
53
using ( var ms = new MemoryStream (
@@ -83,7 +77,7 @@ public async Task<Cid> PutAsync(
83
77
}
84
78
85
79
public async Task < JObject > GetAsync (
86
- Cid id ,
80
+ Cid id ,
87
81
CancellationToken cancel = default ( CancellationToken ) )
88
82
{
89
83
var json = await ipfs . DoCommandAsync ( "dag/get" , cancel , id ) ;
@@ -92,7 +86,7 @@ public async Task<JObject> GetAsync(
92
86
93
87
94
88
public async Task < JToken > GetAsync (
95
- string path ,
89
+ string path ,
96
90
CancellationToken cancel = default ( CancellationToken ) )
97
91
{
98
92
var json = await ipfs . DoCommandAsync ( "dag/get" , cancel , path ) ;
0 commit comments