@libp2p/interface-internal 2.2.4-d72b51184 → 2.3.0-d8f003e6e

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.
Files changed (53) hide show
  1. package/dist/src/{address-manager/index.d.ts → address-manager.d.ts} +1 -1
  2. package/dist/src/address-manager.d.ts.map +1 -0
  3. package/dist/src/address-manager.js +2 -0
  4. package/dist/src/address-manager.js.map +1 -0
  5. package/dist/src/{connection-manager/index.d.ts → connection-manager.d.ts} +1 -1
  6. package/dist/src/connection-manager.d.ts.map +1 -0
  7. package/dist/src/connection-manager.js +2 -0
  8. package/dist/src/connection-manager.js.map +1 -0
  9. package/dist/src/index.d.ts +5 -6
  10. package/dist/src/index.d.ts.map +1 -1
  11. package/dist/src/index.js +5 -6
  12. package/dist/src/index.js.map +1 -1
  13. package/dist/src/{random-walk/index.d.ts → random-walk.d.ts} +1 -1
  14. package/dist/src/random-walk.d.ts.map +1 -0
  15. package/dist/src/random-walk.js +2 -0
  16. package/dist/src/random-walk.js.map +1 -0
  17. package/dist/src/registrar.d.ts +55 -0
  18. package/dist/src/registrar.d.ts.map +1 -0
  19. package/dist/src/registrar.js +2 -0
  20. package/dist/src/registrar.js.map +1 -0
  21. package/dist/src/{transport-manager/index.d.ts → transport-manager.d.ts} +1 -1
  22. package/dist/src/transport-manager.d.ts.map +1 -0
  23. package/dist/src/transport-manager.js +2 -0
  24. package/dist/src/transport-manager.js.map +1 -0
  25. package/package.json +4 -5
  26. package/src/index.ts +5 -6
  27. package/src/registrar.ts +66 -0
  28. package/dist/src/address-manager/index.d.ts.map +0 -1
  29. package/dist/src/address-manager/index.js +0 -2
  30. package/dist/src/address-manager/index.js.map +0 -1
  31. package/dist/src/connection-manager/index.d.ts.map +0 -1
  32. package/dist/src/connection-manager/index.js +0 -2
  33. package/dist/src/connection-manager/index.js.map +0 -1
  34. package/dist/src/random-walk/index.d.ts.map +0 -1
  35. package/dist/src/random-walk/index.js +0 -2
  36. package/dist/src/random-walk/index.js.map +0 -1
  37. package/dist/src/record/index.d.ts +0 -33
  38. package/dist/src/record/index.d.ts.map +0 -1
  39. package/dist/src/record/index.js +0 -2
  40. package/dist/src/record/index.js.map +0 -1
  41. package/dist/src/registrar/index.d.ts +0 -83
  42. package/dist/src/registrar/index.d.ts.map +0 -1
  43. package/dist/src/registrar/index.js +0 -2
  44. package/dist/src/registrar/index.js.map +0 -1
  45. package/dist/src/transport-manager/index.d.ts.map +0 -1
  46. package/dist/src/transport-manager/index.js +0 -2
  47. package/dist/src/transport-manager/index.js.map +0 -1
  48. package/src/record/index.ts +0 -35
  49. package/src/registrar/index.ts +0 -97
  50. /package/src/{address-manager/index.ts → address-manager.ts} +0 -0
  51. /package/src/{connection-manager/index.ts → connection-manager.ts} +0 -0
  52. /package/src/{random-walk/index.ts → random-walk.ts} +0 -0
  53. /package/src/{transport-manager/index.ts → transport-manager.ts} +0 -0
@@ -113,4 +113,4 @@ export interface AddressManager {
113
113
  */
114
114
  removePublicAddressMapping(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
115
115
  }
116
- //# sourceMappingURL=index.d.ts.map
116
+ //# sourceMappingURL=address-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-manager.d.ts","sourceRoot":"","sources":["../../src/address-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAA;AAE9F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,OAAO,EAAE,MAA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KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;CACjJ"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=address-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-manager.js","sourceRoot":"","sources":["../../src/address-manager.ts"],"names":[],"mappings":""}
@@ -103,4 +103,4 @@ export interface ConnectionManager {
103
103
  */
104
104
  isDialable(multiaddr: Multiaddr | Multiaddr[], options?: IsDialableOptions): Promise<boolean>;
105
105
  }
106
- //# sourceMappingURL=index.d.ts.map
106
+ //# sourceMappingURL=connection-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-manager.d.ts","sourceRoot":"","sources":["../../src/connection-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAC5J,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,eAAe,CAAC,4BAA4B,CAAC;IACxG;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;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;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAA;IAE3B;;;;;;;;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;IAE7B;;;;;;;;OAQG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-manager.js","sourceRoot":"","sources":["../../src/connection-manager.ts"],"names":[],"mappings":""}
@@ -1,7 +1,6 @@
1
- export * from './address-manager/index.js';
2
- export * from './connection-manager/index.js';
3
- export * from './random-walk/index.js';
4
- export * from './record/index.js';
5
- export * from './registrar/index.js';
6
- export * from './transport-manager/index.js';
1
+ export * from './address-manager.js';
2
+ export * from './connection-manager.js';
3
+ export * from './random-walk.js';
4
+ export * from './registrar.js';
5
+ export * from './transport-manager.js';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,wBAAwB,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,7 +1,6 @@
1
- export * from './address-manager/index.js';
2
- export * from './connection-manager/index.js';
3
- export * from './random-walk/index.js';
4
- export * from './record/index.js';
5
- export * from './registrar/index.js';
6
- export * from './transport-manager/index.js';
1
+ export * from './address-manager.js';
2
+ export * from './connection-manager.js';
3
+ export * from './random-walk.js';
4
+ export * from './registrar.js';
5
+ export * from './transport-manager.js';
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,wBAAwB,CAAA"}
@@ -10,4 +10,4 @@ export interface RandomWalk {
10
10
  */
11
11
  walk(options?: AbortOptions): AsyncGenerator<PeerInfo>;
12
12
  }
13
- //# sourceMappingURL=index.d.ts.map
13
+ //# sourceMappingURL=random-walk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-walk.d.ts","sourceRoot":"","sources":["../../src/random-walk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=random-walk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"random-walk.js","sourceRoot":"","sources":["../../src/random-walk.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, IncomingStreamData } from '@libp2p/interface';
2
+ export type {
3
+ /**
4
+ * @deprecated This type should be imported from @libp2p/interface directly
5
+ */
6
+ IncomingStreamData,
7
+ /**
8
+ * @deprecated This type should be imported from @libp2p/interface directly
9
+ */
10
+ StreamHandler,
11
+ /**
12
+ * @deprecated This type should be imported from @libp2p/interface directly
13
+ */
14
+ StreamHandlerOptions,
15
+ /**
16
+ * @deprecated This type should be imported from @libp2p/interface directly
17
+ */
18
+ StreamHandlerRecord };
19
+ export interface Registrar {
20
+ /**
21
+ * Return the list of protocols with registered handlers
22
+ */
23
+ getProtocols(): string[];
24
+ /**
25
+ * Add a protocol handler
26
+ */
27
+ handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>;
28
+ /**
29
+ * Remove a protocol handler
30
+ */
31
+ unhandle(protocol: string): Promise<void>;
32
+ /**
33
+ * Return the handler for the passed protocol
34
+ */
35
+ getHandler(protocol: string): StreamHandlerRecord;
36
+ /**
37
+ * Register a topology handler for a protocol - the topology will be
38
+ * invoked when peers are discovered on the network that support the
39
+ * passed protocol.
40
+ *
41
+ * An id will be returned that can later be used to unregister the
42
+ * topology.
43
+ */
44
+ register(protocol: string, topology: Topology): Promise<string>;
45
+ /**
46
+ * Remove the topology handler with the passed id.
47
+ */
48
+ unregister(id: string): void;
49
+ /**
50
+ * Return all topology handlers that wish to be informed about peers
51
+ * that support the passed protocol.
52
+ */
53
+ getTopologies(protocol: string): Topology[];
54
+ }
55
+ //# sourceMappingURL=registrar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registrar.d.ts","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE/H,YAAY;AACV;;GAEG;AACH,kBAAkB;AAElB;;GAEG;AACH,aAAa;AAEb;;GAEG;AACH,oBAAoB;AAEpB;;GAEG;AACH,mBAAmB,EACpB,CAAA;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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=registrar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registrar.js","sourceRoot":"","sources":["../../src/registrar.ts"],"names":[],"mappings":""}
@@ -49,4 +49,4 @@ export interface TransportManager {
49
49
  */
50
50
  removeAll(): Promise<void>;
51
51
  }
52
- //# sourceMappingURL=index.d.ts.map
52
+ //# sourceMappingURL=transport-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAA;AAC1H,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,2BAA4B,SAAQ,YAAY,EAAE,eAAe,CAAC,kCAAkC,CAAC;CAErH;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE/E;;OAEG;IACH,QAAQ,IAAI,SAAS,EAAE,CAAA;IAEvB;;OAEG;IACH,aAAa,IAAI,SAAS,EAAE,CAAA;IAE5B;;OAEG;IACH,YAAY,IAAI,QAAQ,EAAE,CAAA;IAE1B;;OAEG;IACH,yBAAyB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAE/D;;;OAGG;IACH,2BAA2B,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAEjE;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=transport-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-manager.js","sourceRoot":"","sources":["../../src/transport-manager.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-internal",
3
- "version": "2.2.4-d72b51184",
3
+ "version": "2.3.0-d8f003e6e",
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/main/packages/interface-internal#readme",
@@ -48,11 +48,10 @@
48
48
  "build": "aegir build"
49
49
  },
50
50
  "dependencies": {
51
- "@libp2p/interface": "2.4.1-d72b51184",
52
- "@libp2p/peer-collections": "6.0.16-d72b51184",
51
+ "@libp2p/interface": "2.5.0-d8f003e6e",
52
+ "@libp2p/peer-collections": "6.0.17-d8f003e6e",
53
53
  "@multiformats/multiaddr": "^12.3.3",
54
- "progress-events": "^1.0.1",
55
- "uint8arraylist": "^2.4.8"
54
+ "progress-events": "^1.0.1"
56
55
  },
57
56
  "devDependencies": {
58
57
  "aegir": "^45.0.5"
package/src/index.ts CHANGED
@@ -1,6 +1,5 @@
1
- export * from './address-manager/index.js'
2
- export * from './connection-manager/index.js'
3
- export * from './random-walk/index.js'
4
- export * from './record/index.js'
5
- export * from './registrar/index.js'
6
- export * from './transport-manager/index.js'
1
+ export * from './address-manager.js'
2
+ export * from './connection-manager.js'
3
+ export * from './random-walk.js'
4
+ export * from './registrar.js'
5
+ export * from './transport-manager.js'
@@ -0,0 +1,66 @@
1
+ import type { StreamHandler, StreamHandlerOptions, StreamHandlerRecord, Topology, IncomingStreamData } from '@libp2p/interface'
2
+
3
+ export type {
4
+ /**
5
+ * @deprecated This type should be imported from @libp2p/interface directly
6
+ */
7
+ IncomingStreamData,
8
+
9
+ /**
10
+ * @deprecated This type should be imported from @libp2p/interface directly
11
+ */
12
+ StreamHandler,
13
+
14
+ /**
15
+ * @deprecated This type should be imported from @libp2p/interface directly
16
+ */
17
+ StreamHandlerOptions,
18
+
19
+ /**
20
+ * @deprecated This type should be imported from @libp2p/interface directly
21
+ */
22
+ StreamHandlerRecord
23
+ }
24
+
25
+ export interface Registrar {
26
+ /**
27
+ * Return the list of protocols with registered handlers
28
+ */
29
+ getProtocols(): string[]
30
+
31
+ /**
32
+ * Add a protocol handler
33
+ */
34
+ handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>
35
+
36
+ /**
37
+ * Remove a protocol handler
38
+ */
39
+ unhandle(protocol: string): Promise<void>
40
+
41
+ /**
42
+ * Return the handler for the passed protocol
43
+ */
44
+ getHandler(protocol: string): StreamHandlerRecord
45
+
46
+ /**
47
+ * Register a topology handler for a protocol - the topology will be
48
+ * invoked when peers are discovered on the network that support the
49
+ * passed protocol.
50
+ *
51
+ * An id will be returned that can later be used to unregister the
52
+ * topology.
53
+ */
54
+ register(protocol: string, topology: Topology): Promise<string>
55
+
56
+ /**
57
+ * Remove the topology handler with the passed id.
58
+ */
59
+ unregister(id: string): void
60
+
61
+ /**
62
+ * Return all topology handlers that wish to be informed about peers
63
+ * that support the passed protocol.
64
+ */
65
+ getTopologies(protocol: string): Topology[]
66
+ }
@@ -1 +0,0 @@
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;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,YAAY,CAAA;AAE9F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IAEpB;;;;;;OA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,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;CACjJ"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAC5J,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,YAAY,EAAE,eAAe,CAAC,4BAA4B,CAAC;IACxG;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;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;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAA;IAE3B;;;;;;;;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;IAE7B;;;;;;;;OAQG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9F"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection-manager/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/random-walk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;CACvD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/random-walk/index.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- import type { PeerId } from '@libp2p/interface';
2
- import type { Uint8ArrayList } from 'uint8arraylist';
3
- /**
4
- * Record is the base implementation of a record that can be used as the payload of a libp2p envelope.
5
- */
6
- export interface Record {
7
- /**
8
- * signature domain.
9
- */
10
- domain: string;
11
- /**
12
- * identifier of the type of record
13
- */
14
- codec: Uint8Array;
15
- /**
16
- * Marshal a record to be used in an envelope.
17
- */
18
- marshal(): Uint8Array;
19
- /**
20
- * Verifies if the other provided Record is identical to this one.
21
- */
22
- equals(other: Record): boolean;
23
- }
24
- export interface Envelope {
25
- peerId: PeerId;
26
- payloadType: Uint8Array | Uint8ArrayList;
27
- payload: Uint8Array;
28
- signature: Uint8Array | Uint8ArrayList;
29
- marshal(): Uint8Array;
30
- validate(domain: string): Promise<boolean>;
31
- equals(other: Envelope): boolean;
32
- }
33
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/record/index.ts"],"names":[],"mappings":""}
@@ -1,83 +0,0 @@
1
- import type { Connection, Stream, Topology } from '@libp2p/interface';
2
- export interface IncomingStreamData {
3
- /**
4
- * The stream that has been opened
5
- */
6
- stream: Stream;
7
- /**
8
- * The connection that the stream was opened on
9
- */
10
- connection: Connection;
11
- }
12
- export interface StreamHandler {
13
- (data: IncomingStreamData): void;
14
- }
15
- export interface StreamHandlerOptions {
16
- /**
17
- * How many incoming streams can be open for this protocol at the same time on each connection
18
- *
19
- * @default 32
20
- */
21
- maxInboundStreams?: number;
22
- /**
23
- * How many outgoing streams can be open for this protocol at the same time on each connection
24
- *
25
- * @default 64
26
- */
27
- maxOutboundStreams?: number;
28
- /**
29
- * If true, allow this protocol to run on limited connections (e.g.
30
- * connections with data or duration limits such as circuit relay
31
- * connections)
32
- *
33
- * @default false
34
- */
35
- runOnLimitedConnection?: boolean;
36
- }
37
- export interface StreamHandlerRecord {
38
- /**
39
- * The handler that was registered to handle streams opened on the protocol
40
- */
41
- handler: StreamHandler;
42
- /**
43
- * The options that were used to register the stream handler
44
- */
45
- options: StreamHandlerOptions;
46
- }
47
- export interface Registrar {
48
- /**
49
- * Return the list of protocols with registered handlers
50
- */
51
- getProtocols(): string[];
52
- /**
53
- * Add a protocol handler
54
- */
55
- handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>;
56
- /**
57
- * Remove a protocol handler
58
- */
59
- unhandle(protocol: string): Promise<void>;
60
- /**
61
- * Return the handler for the passed protocol
62
- */
63
- getHandler(protocol: string): StreamHandlerRecord;
64
- /**
65
- * Register a topology handler for a protocol - the topology will be
66
- * invoked when peers are discovered on the network that support the
67
- * passed protocol.
68
- *
69
- * An id will be returned that can later be used to unregister the
70
- * topology.
71
- */
72
- register(protocol: string, topology: Topology): Promise<string>;
73
- /**
74
- * Remove the topology handler with the passed id.
75
- */
76
- unregister(id: string): void;
77
- /**
78
- * Return all topology handlers that wish to be informed about peers
79
- * that support the passed protocol.
80
- */
81
- getTopologies(protocol: string): Topology[];
82
- }
83
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/registrar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAErE,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAA;IAEtB;;OAEG;IACH,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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/registrar/index.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAA;AAC1H,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,WAAW,2BAA4B,SAAQ,YAAY,EAAE,eAAe,CAAC,kCAAkC,CAAC;CAErH;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE/E;;OAEG;IACH,QAAQ,IAAI,SAAS,EAAE,CAAA;IAEvB;;OAEG;IACH,aAAa,IAAI,SAAS,EAAE,CAAA;IAE5B;;OAEG;IACH,YAAY,IAAI,QAAQ,EAAE,CAAA;IAE1B;;OAEG;IACH,yBAAyB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAE/D;;;OAGG;IACH,2BAA2B,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAEjE;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import type { PeerId } from '@libp2p/interface'
2
- import type { Uint8ArrayList } from 'uint8arraylist'
3
-
4
- /**
5
- * Record is the base implementation of a record that can be used as the payload of a libp2p envelope.
6
- */
7
- export interface Record {
8
- /**
9
- * signature domain.
10
- */
11
- domain: string
12
- /**
13
- * identifier of the type of record
14
- */
15
- codec: Uint8Array
16
- /**
17
- * Marshal a record to be used in an envelope.
18
- */
19
- marshal(): Uint8Array
20
- /**
21
- * Verifies if the other provided Record is identical to this one.
22
- */
23
- equals(other: Record): boolean
24
- }
25
-
26
- export interface Envelope {
27
- peerId: PeerId
28
- payloadType: Uint8Array | Uint8ArrayList
29
- payload: Uint8Array
30
- signature: Uint8Array | Uint8ArrayList
31
-
32
- marshal(): Uint8Array
33
- validate(domain: string): Promise<boolean>
34
- equals(other: Envelope): boolean
35
- }
@@ -1,97 +0,0 @@
1
- import type { Connection, Stream, Topology } from '@libp2p/interface'
2
-
3
- export interface IncomingStreamData {
4
- /**
5
- * The stream that has been opened
6
- */
7
- stream: Stream
8
-
9
- /**
10
- * The connection that the stream was opened on
11
- */
12
- connection: Connection
13
- }
14
-
15
- export interface StreamHandler {
16
- (data: IncomingStreamData): void
17
- }
18
-
19
- export interface StreamHandlerOptions {
20
- /**
21
- * How many incoming streams can be open for this protocol at the same time on each connection
22
- *
23
- * @default 32
24
- */
25
- maxInboundStreams?: number
26
-
27
- /**
28
- * How many outgoing streams can be open for this protocol at the same time on each connection
29
- *
30
- * @default 64
31
- */
32
- maxOutboundStreams?: number
33
-
34
- /**
35
- * If true, allow this protocol to run on limited connections (e.g.
36
- * connections with data or duration limits such as circuit relay
37
- * connections)
38
- *
39
- * @default false
40
- */
41
- runOnLimitedConnection?: boolean
42
- }
43
-
44
- export interface StreamHandlerRecord {
45
- /**
46
- * The handler that was registered to handle streams opened on the protocol
47
- */
48
- handler: StreamHandler
49
-
50
- /**
51
- * The options that were used to register the stream handler
52
- */
53
- options: StreamHandlerOptions
54
- }
55
-
56
- export interface Registrar {
57
- /**
58
- * Return the list of protocols with registered handlers
59
- */
60
- getProtocols(): string[]
61
-
62
- /**
63
- * Add a protocol handler
64
- */
65
- handle(protocol: string, handler: StreamHandler, options?: StreamHandlerOptions): Promise<void>
66
-
67
- /**
68
- * Remove a protocol handler
69
- */
70
- unhandle(protocol: string): Promise<void>
71
-
72
- /**
73
- * Return the handler for the passed protocol
74
- */
75
- getHandler(protocol: string): StreamHandlerRecord
76
-
77
- /**
78
- * Register a topology handler for a protocol - the topology will be
79
- * invoked when peers are discovered on the network that support the
80
- * passed protocol.
81
- *
82
- * An id will be returned that can later be used to unregister the
83
- * topology.
84
- */
85
- register(protocol: string, topology: Topology): Promise<string>
86
-
87
- /**
88
- * Remove the topology handler with the passed id.
89
- */
90
- unregister(id: string): void
91
-
92
- /**
93
- * Return all topology handlers that wish to be informed about peers
94
- * that support the passed protocol.
95
- */
96
- getTopologies(protocol: string): Topology[]
97
- }
File without changes