This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 6 files changed +11
-12
lines changed
6 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export interface API<OptionExtension = {}> {
24
24
* // [ CID('QmHash') ]
25
25
* ```
26
26
*/
27
- wantlistForPeer : ( peerId : CID | string , options ?: AbortOptions & OptionExtension ) => Promise < CID [ ] >
27
+ wantlistForPeer : ( peerId : string , options ?: AbortOptions & OptionExtension ) => Promise < CID [ ] >
28
28
29
29
/**
30
30
* Removes one or more CIDs from the wantlist
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export interface API<OptionExtension = {}> {
21
21
* // '/ip4/147.75.94.115/tcp/4001'
22
22
* ```
23
23
*/
24
- findPeer : ( peerId : CID | string , options ?: AbortOptions & OptionExtension ) => Promise < PeerResult >
24
+ findPeer : ( peerId : string , options ?: AbortOptions & OptionExtension ) => Promise < PeerResult >
25
25
26
26
/**
27
27
* Find peers in the DHT that can provide a specific value, given a CID.
@@ -59,7 +59,7 @@ export interface API<OptionExtension = {}> {
59
59
/**
60
60
* Find the closest peers to a given `PeerId`, by querying the DHT.
61
61
*/
62
- query : ( peerId : CID | string , options ?: AbortOptions & OptionExtension ) => AsyncIterable < PeerResult >
62
+ query : ( peerId : string , options ?: AbortOptions & OptionExtension ) => AsyncIterable < PeerResult >
63
63
}
64
64
65
65
export interface PeerResult {
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export interface API<OptionExtension = {}> {
82
82
* }
83
83
* ```
84
84
*/
85
- ping : ( peerId : CID | string , options ?: PingOptions & OptionExtension ) => AsyncIterable < PingResult >
85
+ ping : ( peerId : string , options ?: PingOptions & OptionExtension ) => AsyncIterable < PingResult >
86
86
87
87
/**
88
88
* Resolve the value of names to IPFS
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export interface API<OptionExtension = {}> {
14
14
}
15
15
16
16
export interface BWOptions extends AbortOptions {
17
- peer ?: CID | string
17
+ peer ?: string
18
18
proto ?: string
19
19
poll ?: boolean
20
20
interval ?: number
Original file line number Diff line number Diff line change @@ -5,20 +5,20 @@ import type CID from 'cids'
5
5
import type { Multiaddr } from 'multiaddr'
6
6
7
7
export interface API < OptionExtension = { } > {
8
- /**
8
+ /**
9
9
* List of known addresses of each peer connected
10
10
*/
11
11
addrs : ( options ?: AbortOptions & OptionExtension ) => Promise < AddrsResult [ ] >
12
12
13
13
/**
14
- * Open a connection to a given address
14
+ * Open a connection to a given address or peer id
15
15
*/
16
- connect : ( addr : Multiaddr , options ?: AbortOptions & OptionExtension ) => Promise < void >
16
+ connect : ( addr : Multiaddr | string , options ?: AbortOptions & OptionExtension ) => Promise < void >
17
17
18
18
/**
19
- * Close a connection to a given address
19
+ * Close a connection to a given address or peer id
20
20
*/
21
- disconnect : ( addr : Multiaddr , options ?: AbortOptions & OptionExtension ) => Promise < void >
21
+ disconnect : ( addr : Multiaddr | string , options ?: AbortOptions & OptionExtension ) => Promise < void >
22
22
23
23
/**
24
24
* Local addresses this node is listening on
Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const CID = require ( 'cids' )
4
3
const { Multiaddr } = require ( 'multiaddr' )
5
4
const configure = require ( '../lib/configure' )
6
5
const toUrlSearchParams = require ( '../lib/to-url-search-params' )
@@ -20,7 +19,7 @@ module.exports = configure(api => {
20
19
timeout : options . timeout ,
21
20
signal : options . signal ,
22
21
searchParams : toUrlSearchParams ( {
23
- arg : ` ${ peerId instanceof Uint8Array ? new CID ( peerId ) : peerId } ` ,
22
+ arg : peerId ,
24
23
...options
25
24
} ) ,
26
25
headers : options . headers
You can’t perform that action at this time.
0 commit comments