@libp2p/interface-internal 0.1.5 → 0.1.6-62a56b54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/address-manager/index.d.ts +7 -7
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.d.ts +7 -7
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/record/index.d.ts +5 -5
- package/dist/src/record/index.d.ts.map +1 -1
- package/dist/src/registrar/index.d.ts +7 -7
- package/dist/src/registrar/index.d.ts.map +1 -1
- package/dist/src/transport-manager/index.d.ts +9 -9
- package/dist/src/transport-manager/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/address-manager/index.ts +7 -7
- package/src/connection-manager/index.ts +7 -7
- package/src/record/index.ts +5 -5
- package/src/registrar/index.ts +7 -7
- package/src/transport-manager/index.ts +9 -9
- package/dist/typedoc-urls.json +0 -24
|
@@ -3,35 +3,35 @@ export interface AddressManager {
|
|
|
3
3
|
/**
|
|
4
4
|
* Get peer listen multiaddrs
|
|
5
5
|
*/
|
|
6
|
-
getListenAddrs
|
|
6
|
+
getListenAddrs(): Multiaddr[];
|
|
7
7
|
/**
|
|
8
8
|
* Get peer announcing multiaddrs
|
|
9
9
|
*/
|
|
10
|
-
getAnnounceAddrs
|
|
10
|
+
getAnnounceAddrs(): Multiaddr[];
|
|
11
11
|
/**
|
|
12
12
|
* Get observed multiaddrs - these addresses may not have been confirmed as
|
|
13
13
|
* publicly dialable yet
|
|
14
14
|
*/
|
|
15
|
-
getObservedAddrs
|
|
15
|
+
getObservedAddrs(): Multiaddr[];
|
|
16
16
|
/**
|
|
17
17
|
* Signal that we have confidence an observed multiaddr is publicly dialable -
|
|
18
18
|
* this will make it appear in the output of getAddresses()
|
|
19
19
|
*/
|
|
20
|
-
confirmObservedAddr
|
|
20
|
+
confirmObservedAddr(addr: Multiaddr): void;
|
|
21
21
|
/**
|
|
22
22
|
* Signal that we do not have confidence an observed multiaddr is publicly dialable -
|
|
23
23
|
* this will remove it from the output of getObservedAddrs()
|
|
24
24
|
*/
|
|
25
|
-
removeObservedAddr
|
|
25
|
+
removeObservedAddr(addr: Multiaddr): void;
|
|
26
26
|
/**
|
|
27
27
|
* Add peer observed addresses. These will then appear in the output of getObservedAddrs
|
|
28
28
|
* but not getAddresses() until their dialability has been confirmed via a call to
|
|
29
29
|
* confirmObservedAddr.
|
|
30
30
|
*/
|
|
31
|
-
addObservedAddr
|
|
31
|
+
addObservedAddr(addr: Multiaddr): void;
|
|
32
32
|
/**
|
|
33
33
|
* Get the current node's addresses
|
|
34
34
|
*/
|
|
35
|
-
getAddresses
|
|
35
|
+
getAddresses(): Multiaddr[];
|
|
36
36
|
}
|
|
37
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,cAAc,IAAI,SAAS,EAAE,CAAA;IAE7B;;OAEG;IACH,gBAAgB,IAAI,SAAS,EAAE,CAAA;IAE/B;;;OAGG;IACH,gBAAgB,IAAI,SAAS,EAAE,CAAA;IAE/B;;;OAGG;IACH,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAE1C;;;OAGG;IACH,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAEzC;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAAA;IAEtC;;OAEG;IACH,YAAY,IAAI,SAAS,EAAE,CAAA;CAC5B"}
|
|
@@ -27,7 +27,7 @@ export interface ConnectionManager {
|
|
|
27
27
|
* // []
|
|
28
28
|
* ```
|
|
29
29
|
*/
|
|
30
|
-
getConnections
|
|
30
|
+
getConnections(peerId?: PeerId): Connection[];
|
|
31
31
|
/**
|
|
32
32
|
* Return a map of all connections with their associated PeerIds
|
|
33
33
|
*
|
|
@@ -37,7 +37,7 @@ export interface ConnectionManager {
|
|
|
37
37
|
* const connectionsMap = libp2p.connectionManager.getConnectionsMap()
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
getConnectionsMap
|
|
40
|
+
getConnectionsMap(): PeerMap<Connection[]>;
|
|
41
41
|
/**
|
|
42
42
|
* Open a connection to a remote peer
|
|
43
43
|
*
|
|
@@ -47,22 +47,22 @@ export interface ConnectionManager {
|
|
|
47
47
|
* const connection = await libp2p.connectionManager.openConnection(peerId)
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
|
-
openConnection
|
|
50
|
+
openConnection(peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise<Connection>;
|
|
51
51
|
/**
|
|
52
52
|
* Close our connections to a peer
|
|
53
53
|
*/
|
|
54
|
-
closeConnections
|
|
54
|
+
closeConnections(peer: PeerId, options?: AbortOptions): Promise<void>;
|
|
55
55
|
/**
|
|
56
56
|
* Invoked after an incoming connection is opened but before PeerIds are
|
|
57
57
|
* exchanged, this lets the ConnectionManager check we have sufficient
|
|
58
58
|
* resources to accept the connection in which case it will return true,
|
|
59
59
|
* otherwise it will return false.
|
|
60
60
|
*/
|
|
61
|
-
acceptIncomingConnection
|
|
61
|
+
acceptIncomingConnection(maConn: MultiaddrConnection): Promise<boolean>;
|
|
62
62
|
/**
|
|
63
63
|
* Invoked after upgrading a multiaddr connection has finished
|
|
64
64
|
*/
|
|
65
|
-
afterUpgradeInbound
|
|
65
|
+
afterUpgradeInbound(): void;
|
|
66
66
|
/**
|
|
67
67
|
* Return the list of in-progress or queued dials
|
|
68
68
|
*
|
|
@@ -72,6 +72,6 @@ export interface ConnectionManager {
|
|
|
72
72
|
* const dials = libp2p.connectionManager.getDialQueue()
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
getDialQueue
|
|
75
|
+
getDialQueue(): PendingDial[];
|
|
76
76
|
}
|
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;OASG;IACH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;OASG;IACH,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,EAAE,CAAA;IAE7C;;;;;;;;OAQG;IACH,iBAAiB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAE1C;;;;;;;;OAQG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE5G;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErE;;;;;OAKG;IACH,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvE;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAA;IAE3B;;;;;;;;OAQG;IACH,YAAY,IAAI,WAAW,EAAE,CAAA;CAC9B"}
|
|
@@ -15,19 +15,19 @@ export interface Record {
|
|
|
15
15
|
/**
|
|
16
16
|
* Marshal a record to be used in an envelope.
|
|
17
17
|
*/
|
|
18
|
-
marshal
|
|
18
|
+
marshal(): Uint8Array;
|
|
19
19
|
/**
|
|
20
20
|
* Verifies if the other provided Record is identical to this one.
|
|
21
21
|
*/
|
|
22
|
-
equals
|
|
22
|
+
equals(other: Record): boolean;
|
|
23
23
|
}
|
|
24
24
|
export interface Envelope {
|
|
25
25
|
peerId: PeerId;
|
|
26
26
|
payloadType: Uint8Array | Uint8ArrayList;
|
|
27
27
|
payload: Uint8Array;
|
|
28
28
|
signature: Uint8Array | Uint8ArrayList;
|
|
29
|
-
marshal
|
|
30
|
-
validate
|
|
31
|
-
equals
|
|
29
|
+
marshal(): Uint8Array;
|
|
30
|
+
validate(domain: string): Promise<boolean>;
|
|
31
|
+
equals(other: Envelope): boolean;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,KAAK,EAAE,UAAU,CAAA;IACjB;;OAEG;IACH,OAAO,IAAI,UAAU,CAAA;IACrB;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,UAAU,GAAG,cAAc,CAAA;IACxC,OAAO,EAAE,UAAU,CAAA;IACnB,SAAS,EAAE,UAAU,GAAG,cAAc,CAAA;IAEtC,OAAO,IAAI,UAAU,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAA;CACjC"}
|
|
@@ -31,19 +31,19 @@ export interface Registrar {
|
|
|
31
31
|
/**
|
|
32
32
|
* Return the list of protocols with registered handlers
|
|
33
33
|
*/
|
|
34
|
-
getProtocols
|
|
34
|
+
getProtocols(): string[];
|
|
35
35
|
/**
|
|
36
36
|
* Add a protocol handler
|
|
37
37
|
*/
|
|
38
|
-
handle
|
|
38
|
+
handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>;
|
|
39
39
|
/**
|
|
40
40
|
* Remove a protocol handler
|
|
41
41
|
*/
|
|
42
|
-
unhandle
|
|
42
|
+
unhandle(protocol: string): Promise<void>;
|
|
43
43
|
/**
|
|
44
44
|
* Return the handler for the passed protocol
|
|
45
45
|
*/
|
|
46
|
-
getHandler
|
|
46
|
+
getHandler(protocol: string): StreamHandlerRecord;
|
|
47
47
|
/**
|
|
48
48
|
* Register a topology handler for a protocol - the topology will be
|
|
49
49
|
* invoked when peers are discovered on the network that support the
|
|
@@ -52,15 +52,15 @@ export interface Registrar {
|
|
|
52
52
|
* An id will be returned that can later be used to unregister the
|
|
53
53
|
* topology.
|
|
54
54
|
*/
|
|
55
|
-
register
|
|
55
|
+
register(protocol: string, topology: Topology): Promise<string>;
|
|
56
56
|
/**
|
|
57
57
|
* Remove the topology handler with the passed id.
|
|
58
58
|
*/
|
|
59
|
-
unregister
|
|
59
|
+
unregister(id: string): void;
|
|
60
60
|
/**
|
|
61
61
|
* Return all topology handlers that wish to be informed about peers
|
|
62
62
|
* that support the passed protocol.
|
|
63
63
|
*/
|
|
64
|
-
getTopologies
|
|
64
|
+
getTopologies(protocol: string): Topology[];
|
|
65
65
|
}
|
|
66
66
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registrar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE1D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,oBAAoB,CAAA;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registrar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE1D,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,CAAA;IACtB,OAAO,EAAE,oBAAoB,CAAA;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE,CAAA;IAExB;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/F;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAAA;IAEjD;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAE/D;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B;;;OAGG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAC5C"}
|
|
@@ -2,14 +2,14 @@ import type { Connection } from '@libp2p/interface/connection';
|
|
|
2
2
|
import type { Listener, Transport } from '@libp2p/interface/transport';
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
4
4
|
export interface TransportManager {
|
|
5
|
-
add
|
|
6
|
-
dial
|
|
7
|
-
getAddrs
|
|
8
|
-
getTransports
|
|
9
|
-
getListeners
|
|
10
|
-
transportForMultiaddr
|
|
11
|
-
listen
|
|
12
|
-
remove
|
|
13
|
-
removeAll
|
|
5
|
+
add(transport: Transport): void;
|
|
6
|
+
dial(ma: Multiaddr, options?: any): Promise<Connection>;
|
|
7
|
+
getAddrs(): Multiaddr[];
|
|
8
|
+
getTransports(): Transport[];
|
|
9
|
+
getListeners(): Listener[];
|
|
10
|
+
transportForMultiaddr(ma: Multiaddr): Transport | undefined;
|
|
11
|
+
listen(addrs: Multiaddr[]): Promise<void>;
|
|
12
|
+
remove(key: string): Promise<void>;
|
|
13
|
+
removeAll(): Promise<void>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;IAC/B,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IACvD,QAAQ,IAAI,SAAS,EAAE,CAAA;IACvB,aAAa,IAAI,SAAS,EAAE,CAAA;IAC5B,YAAY,IAAI,QAAQ,EAAE,CAAA;IAC1B,qBAAqB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3D,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface-internal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-62a56b54",
|
|
4
4
|
"description": "Interfaces implemented by internal libp2p components",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/interface-internal#readme",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"eslintConfig": {
|
|
69
69
|
"extends": "ipfs",
|
|
70
70
|
"parserOptions": {
|
|
71
|
+
"project": true,
|
|
71
72
|
"sourceType": "module"
|
|
72
73
|
}
|
|
73
74
|
},
|
|
@@ -78,12 +79,12 @@
|
|
|
78
79
|
"build": "aegir build"
|
|
79
80
|
},
|
|
80
81
|
"dependencies": {
|
|
81
|
-
"@libp2p/interface": "
|
|
82
|
-
"@libp2p/peer-collections": "
|
|
82
|
+
"@libp2p/interface": "0.1.3-62a56b54",
|
|
83
|
+
"@libp2p/peer-collections": "4.0.5-62a56b54",
|
|
83
84
|
"@multiformats/multiaddr": "^12.1.5",
|
|
84
85
|
"uint8arraylist": "^2.4.3"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
|
-
"aegir": "^
|
|
88
|
+
"aegir": "^41.0.2"
|
|
88
89
|
}
|
|
89
90
|
}
|
|
@@ -4,40 +4,40 @@ export interface AddressManager {
|
|
|
4
4
|
/**
|
|
5
5
|
* Get peer listen multiaddrs
|
|
6
6
|
*/
|
|
7
|
-
getListenAddrs
|
|
7
|
+
getListenAddrs(): Multiaddr[]
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Get peer announcing multiaddrs
|
|
11
11
|
*/
|
|
12
|
-
getAnnounceAddrs
|
|
12
|
+
getAnnounceAddrs(): Multiaddr[]
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Get observed multiaddrs - these addresses may not have been confirmed as
|
|
16
16
|
* publicly dialable yet
|
|
17
17
|
*/
|
|
18
|
-
getObservedAddrs
|
|
18
|
+
getObservedAddrs(): Multiaddr[]
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Signal that we have confidence an observed multiaddr is publicly dialable -
|
|
22
22
|
* this will make it appear in the output of getAddresses()
|
|
23
23
|
*/
|
|
24
|
-
confirmObservedAddr
|
|
24
|
+
confirmObservedAddr(addr: Multiaddr): void
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Signal that we do not have confidence an observed multiaddr is publicly dialable -
|
|
28
28
|
* this will remove it from the output of getObservedAddrs()
|
|
29
29
|
*/
|
|
30
|
-
removeObservedAddr
|
|
30
|
+
removeObservedAddr(addr: Multiaddr): void
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Add peer observed addresses. These will then appear in the output of getObservedAddrs
|
|
34
34
|
* but not getAddresses() until their dialability has been confirmed via a call to
|
|
35
35
|
* confirmObservedAddr.
|
|
36
36
|
*/
|
|
37
|
-
addObservedAddr
|
|
37
|
+
addObservedAddr(addr: Multiaddr): void
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Get the current node's addresses
|
|
41
41
|
*/
|
|
42
|
-
getAddresses
|
|
42
|
+
getAddresses(): Multiaddr[]
|
|
43
43
|
}
|
|
@@ -30,7 +30,7 @@ export interface ConnectionManager {
|
|
|
30
30
|
* // []
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
|
-
getConnections
|
|
33
|
+
getConnections(peerId?: PeerId): Connection[]
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Return a map of all connections with their associated PeerIds
|
|
@@ -41,7 +41,7 @@ export interface ConnectionManager {
|
|
|
41
41
|
* const connectionsMap = libp2p.connectionManager.getConnectionsMap()
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
getConnectionsMap
|
|
44
|
+
getConnectionsMap(): PeerMap<Connection[]>
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Open a connection to a remote peer
|
|
@@ -52,12 +52,12 @@ export interface ConnectionManager {
|
|
|
52
52
|
* const connection = await libp2p.connectionManager.openConnection(peerId)
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
|
-
openConnection
|
|
55
|
+
openConnection(peer: PeerId | Multiaddr | Multiaddr[], options?: OpenConnectionOptions): Promise<Connection>
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Close our connections to a peer
|
|
59
59
|
*/
|
|
60
|
-
closeConnections
|
|
60
|
+
closeConnections(peer: PeerId, options?: AbortOptions): Promise<void>
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Invoked after an incoming connection is opened but before PeerIds are
|
|
@@ -65,12 +65,12 @@ export interface ConnectionManager {
|
|
|
65
65
|
* resources to accept the connection in which case it will return true,
|
|
66
66
|
* otherwise it will return false.
|
|
67
67
|
*/
|
|
68
|
-
acceptIncomingConnection
|
|
68
|
+
acceptIncomingConnection(maConn: MultiaddrConnection): Promise<boolean>
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Invoked after upgrading a multiaddr connection has finished
|
|
72
72
|
*/
|
|
73
|
-
afterUpgradeInbound
|
|
73
|
+
afterUpgradeInbound(): void
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Return the list of in-progress or queued dials
|
|
@@ -81,5 +81,5 @@ export interface ConnectionManager {
|
|
|
81
81
|
* const dials = libp2p.connectionManager.getDialQueue()
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
|
-
getDialQueue
|
|
84
|
+
getDialQueue(): PendingDial[]
|
|
85
85
|
}
|
package/src/record/index.ts
CHANGED
|
@@ -16,11 +16,11 @@ export interface Record {
|
|
|
16
16
|
/**
|
|
17
17
|
* Marshal a record to be used in an envelope.
|
|
18
18
|
*/
|
|
19
|
-
marshal
|
|
19
|
+
marshal(): Uint8Array
|
|
20
20
|
/**
|
|
21
21
|
* Verifies if the other provided Record is identical to this one.
|
|
22
22
|
*/
|
|
23
|
-
equals
|
|
23
|
+
equals(other: Record): boolean
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface Envelope {
|
|
@@ -29,7 +29,7 @@ export interface Envelope {
|
|
|
29
29
|
payload: Uint8Array
|
|
30
30
|
signature: Uint8Array | Uint8ArrayList
|
|
31
31
|
|
|
32
|
-
marshal
|
|
33
|
-
validate
|
|
34
|
-
equals
|
|
32
|
+
marshal(): Uint8Array
|
|
33
|
+
validate(domain: string): Promise<boolean>
|
|
34
|
+
equals(other: Envelope): boolean
|
|
35
35
|
}
|
package/src/registrar/index.ts
CHANGED
|
@@ -38,22 +38,22 @@ export interface Registrar {
|
|
|
38
38
|
/**
|
|
39
39
|
* Return the list of protocols with registered handlers
|
|
40
40
|
*/
|
|
41
|
-
getProtocols
|
|
41
|
+
getProtocols(): string[]
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Add a protocol handler
|
|
45
45
|
*/
|
|
46
|
-
handle
|
|
46
|
+
handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Remove a protocol handler
|
|
50
50
|
*/
|
|
51
|
-
unhandle
|
|
51
|
+
unhandle(protocol: string): Promise<void>
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Return the handler for the passed protocol
|
|
55
55
|
*/
|
|
56
|
-
getHandler
|
|
56
|
+
getHandler(protocol: string): StreamHandlerRecord
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
59
|
* Register a topology handler for a protocol - the topology will be
|
|
@@ -63,16 +63,16 @@ export interface Registrar {
|
|
|
63
63
|
* An id will be returned that can later be used to unregister the
|
|
64
64
|
* topology.
|
|
65
65
|
*/
|
|
66
|
-
register
|
|
66
|
+
register(protocol: string, topology: Topology): Promise<string>
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Remove the topology handler with the passed id.
|
|
70
70
|
*/
|
|
71
|
-
unregister
|
|
71
|
+
unregister(id: string): void
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Return all topology handlers that wish to be informed about peers
|
|
75
75
|
* that support the passed protocol.
|
|
76
76
|
*/
|
|
77
|
-
getTopologies
|
|
77
|
+
getTopologies(protocol: string): Topology[]
|
|
78
78
|
}
|
|
@@ -3,13 +3,13 @@ import type { Listener, Transport } from '@libp2p/interface/transport'
|
|
|
3
3
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
4
4
|
|
|
5
5
|
export interface TransportManager {
|
|
6
|
-
add
|
|
7
|
-
dial
|
|
8
|
-
getAddrs
|
|
9
|
-
getTransports
|
|
10
|
-
getListeners
|
|
11
|
-
transportForMultiaddr
|
|
12
|
-
listen
|
|
13
|
-
remove
|
|
14
|
-
removeAll
|
|
6
|
+
add(transport: Transport): void
|
|
7
|
+
dial(ma: Multiaddr, options?: any): Promise<Connection>
|
|
8
|
+
getAddrs(): Multiaddr[]
|
|
9
|
+
getTransports(): Transport[]
|
|
10
|
+
getListeners(): Listener[]
|
|
11
|
+
transportForMultiaddr(ma: Multiaddr): Transport | undefined
|
|
12
|
+
listen(addrs: Multiaddr[]): Promise<void>
|
|
13
|
+
remove(key: string): Promise<void>
|
|
14
|
+
removeAll(): Promise<void>
|
|
15
15
|
}
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AddressManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.address_manager.AddressManager.html",
|
|
3
|
-
"./address-manager:AddressManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.address_manager.AddressManager.html",
|
|
4
|
-
"ConnectionManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.connection_manager.ConnectionManager.html",
|
|
5
|
-
"./connection-manager:ConnectionManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.connection_manager.ConnectionManager.html",
|
|
6
|
-
"OpenConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.connection_manager.OpenConnectionOptions.html",
|
|
7
|
-
"./connection-manager:OpenConnectionOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.connection_manager.OpenConnectionOptions.html",
|
|
8
|
-
"Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.record.Envelope.html",
|
|
9
|
-
"./record:Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.record.Envelope.html",
|
|
10
|
-
"Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.record.Record.html",
|
|
11
|
-
"./record:Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.record.Record.html",
|
|
12
|
-
"IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.IncomingStreamData.html",
|
|
13
|
-
"./registrar:IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.IncomingStreamData.html",
|
|
14
|
-
"Registrar": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.Registrar.html",
|
|
15
|
-
"./registrar:Registrar": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.Registrar.html",
|
|
16
|
-
"StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandler.html",
|
|
17
|
-
"./registrar:StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandler.html",
|
|
18
|
-
"StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandlerOptions.html",
|
|
19
|
-
"./registrar:StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandlerOptions.html",
|
|
20
|
-
"StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandlerRecord.html",
|
|
21
|
-
"./registrar:StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.registrar.StreamHandlerRecord.html",
|
|
22
|
-
"TransportManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.transport_manager.TransportManager.html",
|
|
23
|
-
"./transport-manager:TransportManager": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface_internal.transport_manager.TransportManager.html"
|
|
24
|
-
}
|