@libp2p/interface 0.0.1-6fdaa7dc

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 (129) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +45 -0
  3. package/dist/index.min.js +3 -0
  4. package/dist/src/connection/index.d.ts +188 -0
  5. package/dist/src/connection/index.d.ts.map +1 -0
  6. package/dist/src/connection/index.js +5 -0
  7. package/dist/src/connection/index.js.map +1 -0
  8. package/dist/src/connection/status.d.ts +4 -0
  9. package/dist/src/connection/status.d.ts.map +1 -0
  10. package/dist/src/connection/status.js +4 -0
  11. package/dist/src/connection/status.js.map +1 -0
  12. package/dist/src/connection-encrypter/index.d.ts +27 -0
  13. package/dist/src/connection-encrypter/index.d.ts.map +1 -0
  14. package/dist/src/connection-encrypter/index.js +2 -0
  15. package/dist/src/connection-encrypter/index.js.map +1 -0
  16. package/dist/src/connection-gater/index.d.ts +117 -0
  17. package/dist/src/connection-gater/index.d.ts.map +1 -0
  18. package/dist/src/connection-gater/index.js +2 -0
  19. package/dist/src/connection-gater/index.js.map +1 -0
  20. package/dist/src/content-routing/index.d.ts +79 -0
  21. package/dist/src/content-routing/index.d.ts.map +1 -0
  22. package/dist/src/content-routing/index.js +21 -0
  23. package/dist/src/content-routing/index.js.map +1 -0
  24. package/dist/src/errors.d.ts +33 -0
  25. package/dist/src/errors.d.ts.map +1 -0
  26. package/dist/src/errors.js +51 -0
  27. package/dist/src/errors.js.map +1 -0
  28. package/dist/src/events.d.ts +28 -0
  29. package/dist/src/events.d.ts.map +1 -0
  30. package/dist/src/events.js +70 -0
  31. package/dist/src/events.js.map +1 -0
  32. package/dist/src/index.d.ts +575 -0
  33. package/dist/src/index.d.ts.map +1 -0
  34. package/dist/src/index.js +17 -0
  35. package/dist/src/index.js.map +1 -0
  36. package/dist/src/keychain/index.d.ts +154 -0
  37. package/dist/src/keychain/index.d.ts.map +1 -0
  38. package/dist/src/keychain/index.js +23 -0
  39. package/dist/src/keychain/index.js.map +1 -0
  40. package/dist/src/keys/index.d.ts +35 -0
  41. package/dist/src/keys/index.d.ts.map +1 -0
  42. package/dist/src/keys/index.js +4 -0
  43. package/dist/src/keys/index.js.map +1 -0
  44. package/dist/src/metrics/index.d.ts +165 -0
  45. package/dist/src/metrics/index.d.ts.map +1 -0
  46. package/dist/src/metrics/index.js +2 -0
  47. package/dist/src/metrics/index.js.map +1 -0
  48. package/dist/src/metrics/tracked-map.d.ts +17 -0
  49. package/dist/src/metrics/tracked-map.d.ts.map +1 -0
  50. package/dist/src/metrics/tracked-map.js +38 -0
  51. package/dist/src/metrics/tracked-map.js.map +1 -0
  52. package/dist/src/peer-discovery/index.d.ts +28 -0
  53. package/dist/src/peer-discovery/index.d.ts.map +1 -0
  54. package/dist/src/peer-discovery/index.js +21 -0
  55. package/dist/src/peer-discovery/index.js.map +1 -0
  56. package/dist/src/peer-id/index.d.ts +30 -0
  57. package/dist/src/peer-id/index.d.ts.map +1 -0
  58. package/dist/src/peer-id/index.js +5 -0
  59. package/dist/src/peer-id/index.js.map +1 -0
  60. package/dist/src/peer-info/index.d.ts +8 -0
  61. package/dist/src/peer-info/index.d.ts.map +1 -0
  62. package/dist/src/peer-info/index.js +2 -0
  63. package/dist/src/peer-info/index.js.map +1 -0
  64. package/dist/src/peer-routing/index.d.ts +51 -0
  65. package/dist/src/peer-routing/index.d.ts.map +1 -0
  66. package/dist/src/peer-routing/index.js +21 -0
  67. package/dist/src/peer-routing/index.js.map +1 -0
  68. package/dist/src/peer-store/index.d.ts +247 -0
  69. package/dist/src/peer-store/index.d.ts.map +1 -0
  70. package/dist/src/peer-store/index.js +2 -0
  71. package/dist/src/peer-store/index.js.map +1 -0
  72. package/dist/src/peer-store/tags.d.ts +2 -0
  73. package/dist/src/peer-store/tags.d.ts.map +1 -0
  74. package/dist/src/peer-store/tags.js +2 -0
  75. package/dist/src/peer-store/tags.js.map +1 -0
  76. package/dist/src/record/index.d.ts +33 -0
  77. package/dist/src/record/index.d.ts.map +1 -0
  78. package/dist/src/record/index.js +2 -0
  79. package/dist/src/record/index.js.map +1 -0
  80. package/dist/src/startable.d.ts +46 -0
  81. package/dist/src/startable.d.ts.map +1 -0
  82. package/dist/src/startable.js +46 -0
  83. package/dist/src/startable.js.map +1 -0
  84. package/dist/src/stream-handler/index.d.ts +23 -0
  85. package/dist/src/stream-handler/index.d.ts.map +1 -0
  86. package/dist/src/stream-handler/index.js +2 -0
  87. package/dist/src/stream-handler/index.js.map +1 -0
  88. package/dist/src/stream-muxer/index.d.ts +51 -0
  89. package/dist/src/stream-muxer/index.d.ts.map +1 -0
  90. package/dist/src/stream-muxer/index.js +2 -0
  91. package/dist/src/stream-muxer/index.js.map +1 -0
  92. package/dist/src/stream-muxer/stream.d.ts +85 -0
  93. package/dist/src/stream-muxer/stream.d.ts.map +1 -0
  94. package/dist/src/stream-muxer/stream.js +255 -0
  95. package/dist/src/stream-muxer/stream.js.map +1 -0
  96. package/dist/src/topology/index.d.ts +9 -0
  97. package/dist/src/topology/index.d.ts.map +1 -0
  98. package/dist/src/topology/index.js +2 -0
  99. package/dist/src/topology/index.js.map +1 -0
  100. package/dist/src/transport/index.d.ts +96 -0
  101. package/dist/src/transport/index.d.ts.map +1 -0
  102. package/dist/src/transport/index.js +19 -0
  103. package/dist/src/transport/index.js.map +1 -0
  104. package/package.json +177 -0
  105. package/src/connection/index.ts +221 -0
  106. package/src/connection/status.ts +4 -0
  107. package/src/connection-encrypter/index.ts +30 -0
  108. package/src/connection-gater/index.ts +128 -0
  109. package/src/content-routing/index.ts +83 -0
  110. package/src/errors.ts +68 -0
  111. package/src/events.ts +100 -0
  112. package/src/index.ts +627 -0
  113. package/src/keychain/index.ts +167 -0
  114. package/src/keys/index.ts +38 -0
  115. package/src/metrics/index.ts +187 -0
  116. package/src/metrics/tracked-map.ts +65 -0
  117. package/src/peer-discovery/index.ts +29 -0
  118. package/src/peer-id/index.ts +39 -0
  119. package/src/peer-info/index.ts +8 -0
  120. package/src/peer-routing/index.ts +53 -0
  121. package/src/peer-store/index.ts +272 -0
  122. package/src/peer-store/tags.ts +2 -0
  123. package/src/record/index.ts +35 -0
  124. package/src/startable.ts +117 -0
  125. package/src/stream-handler/index.ts +27 -0
  126. package/src/stream-muxer/index.ts +58 -0
  127. package/src/stream-muxer/stream.ts +365 -0
  128. package/src/topology/index.ts +10 -0
  129. package/src/transport/index.ts +111 -0
@@ -0,0 +1,28 @@
1
+ export interface EventCallback<EventType> {
2
+ (evt: EventType): void;
3
+ }
4
+ export interface EventObject<EventType> {
5
+ handleEvent: EventCallback<EventType>;
6
+ }
7
+ export type EventHandler<EventType> = EventCallback<EventType> | EventObject<EventType>;
8
+ /**
9
+ * Adds types to the EventTarget class. Hopefully this won't be necessary forever.
10
+ *
11
+ * https://github.com/microsoft/TypeScript/issues/28357
12
+ * https://github.com/microsoft/TypeScript/issues/43477
13
+ * https://github.com/microsoft/TypeScript/issues/299
14
+ * etc
15
+ */
16
+ export declare class EventEmitter<EventMap extends Record<string, any>> extends EventTarget {
17
+ #private;
18
+ listenerCount(type: string): number;
19
+ addEventListener<K extends keyof EventMap>(type: K, listener: EventHandler<EventMap[K]> | null, options?: boolean | AddEventListenerOptions): void;
20
+ removeEventListener<K extends keyof EventMap>(type: K, listener?: EventHandler<EventMap[K]> | null, options?: boolean | EventListenerOptions): void;
21
+ dispatchEvent(event: Event): boolean;
22
+ safeDispatchEvent<Detail>(type: keyof EventMap, detail: CustomEventInit<Detail>): boolean;
23
+ }
24
+ export declare const CustomEvent: {
25
+ new <T>(type: string, eventInitDict?: CustomEventInit<T> | undefined): CustomEvent<T>;
26
+ prototype: CustomEvent<any>;
27
+ };
28
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,SAAS;IAAI,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE;AACpE,MAAM,WAAW,WAAW,CAAC,SAAS;IAAI,WAAW,EAAE,aAAa,CAAC,SAAS,CAAC,CAAA;CAAE;AACjF,MAAM,MAAM,YAAY,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC,CAAA;AAOvF;;;;;;;GAOG;AACH,qBAAa,YAAY,CAAC,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAE,SAAQ,WAAW;;IAGjF,aAAa,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAUpC,gBAAgB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI;IAiBlJ,mBAAmB,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,oBAAoB,GAAG,IAAI;IAcnJ,aAAa,CAAE,KAAK,EAAE,KAAK,GAAG,OAAO;IAerC,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,OAAO;CAG1F;AAoBD,eAAO,MAAM,WAAW;;;CAAgD,CAAA"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Adds types to the EventTarget class. Hopefully this won't be necessary forever.
3
+ *
4
+ * https://github.com/microsoft/TypeScript/issues/28357
5
+ * https://github.com/microsoft/TypeScript/issues/43477
6
+ * https://github.com/microsoft/TypeScript/issues/299
7
+ * etc
8
+ */
9
+ export class EventEmitter extends EventTarget {
10
+ #listeners = new Map();
11
+ listenerCount(type) {
12
+ const listeners = this.#listeners.get(type);
13
+ if (listeners == null) {
14
+ return 0;
15
+ }
16
+ return listeners.length;
17
+ }
18
+ addEventListener(type, listener, options) {
19
+ super.addEventListener(type, listener, options);
20
+ let list = this.#listeners.get(type);
21
+ if (list == null) {
22
+ list = [];
23
+ this.#listeners.set(type, list);
24
+ }
25
+ list.push({
26
+ callback: listener,
27
+ once: (options !== true && options !== false && options?.once) ?? false
28
+ });
29
+ }
30
+ removeEventListener(type, listener, options) {
31
+ super.removeEventListener(type.toString(), listener ?? null, options);
32
+ let list = this.#listeners.get(type);
33
+ if (list == null) {
34
+ return;
35
+ }
36
+ list = list.filter(({ callback }) => callback !== listener);
37
+ this.#listeners.set(type, list);
38
+ }
39
+ dispatchEvent(event) {
40
+ const result = super.dispatchEvent(event);
41
+ let list = this.#listeners.get(event.type);
42
+ if (list == null) {
43
+ return result;
44
+ }
45
+ list = list.filter(({ once }) => !once);
46
+ this.#listeners.set(event.type, list);
47
+ return result;
48
+ }
49
+ safeDispatchEvent(type, detail) {
50
+ return this.dispatchEvent(new CustomEvent(type, detail));
51
+ }
52
+ }
53
+ /**
54
+ * CustomEvent is a standard event but it's not supported by node.
55
+ *
56
+ * Remove this when https://github.com/nodejs/node/issues/40678 is closed.
57
+ *
58
+ * Ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
59
+ */
60
+ class CustomEventPolyfill extends Event {
61
+ /** Returns any custom data event was created with. Typically used for synthetic events. */
62
+ detail;
63
+ constructor(message, data) {
64
+ super(message, data);
65
+ // @ts-expect-error could be undefined
66
+ this.detail = data?.detail;
67
+ }
68
+ }
69
+ export const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill;
70
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,OAAO,YAAmD,SAAQ,WAAW;IACjF,UAAU,GAA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AG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,aAAa,CAAE,KAAY;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QAEzC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE1C,IAAI,IAAI,IAAI,IAAI,EAAE;YAChB,OAAO,MAAM,CAAA;SACd;QAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;QACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;QAErC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,iBAAiB,CAAS,IAAoB,EAAE,MAA+B;QAC7E,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAS,IAAc,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5E,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,mBAA6B,SAAQ,KAAK;IAC9C,2FAA2F;IACpF,MAAM,CAAG;IAEhB,YAAa,OAAe,EAAE,IAAgC;QAC5D,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACpB,sCAAsC;QACtC,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,CAAA;IAC5B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,IAAI,mBAAmB,CAAA"}
@@ -0,0 +1,575 @@
1
+ /**
2
+ * @packageDocumentation
3
+ *
4
+ * Exports a `Libp2p` type for modules to use as a type argument.
5
+ *
6
+ * @example
7
+ *
8
+ * ```typescript
9
+ * import type { Libp2p } from '@libp2p/interface'
10
+ *
11
+ * function doSomethingWithLibp2p (node: Libp2p) {
12
+ * // ...
13
+ * }
14
+ * ```
15
+ */
16
+ import type { Connection, Stream } from './connection/index.js';
17
+ import type { ContentRouting } from './content-routing/index.js';
18
+ import type { EventEmitter } from './events.js';
19
+ import type { KeyChain } from './keychain/index.js';
20
+ import type { Metrics } from './metrics/index.js';
21
+ import type { PeerId } from './peer-id/index.js';
22
+ import type { PeerInfo } from './peer-info/index.js';
23
+ import type { PeerRouting } from './peer-routing/index.js';
24
+ import type { Address, Peer, PeerStore } from './peer-store/index.js';
25
+ import type { Startable } from './startable.js';
26
+ import type { StreamHandler, StreamHandlerOptions } from './stream-handler/index.js';
27
+ import type { Topology } from './topology/index.js';
28
+ import type { Listener } from './transport/index.js';
29
+ import type { Multiaddr } from '@multiformats/multiaddr';
30
+ /**
31
+ * Used by the connection manager to sort addresses into order before dialling
32
+ */
33
+ export interface AddressSorter {
34
+ (a: Address, b: Address): -1 | 0 | 1;
35
+ }
36
+ /**
37
+ * Event detail emitted when peer data changes
38
+ */
39
+ export interface PeerUpdate {
40
+ peer: Peer;
41
+ previous?: Peer;
42
+ }
43
+ /**
44
+ * Peer data signed by the remote Peer's public key
45
+ */
46
+ export interface SignedPeerRecord {
47
+ addresses: Multiaddr[];
48
+ seq: bigint;
49
+ }
50
+ /**
51
+ * Data returned from a successful identify response
52
+ */
53
+ export interface IdentifyResult {
54
+ /**
55
+ * The remote Peer's PeerId
56
+ */
57
+ peerId: PeerId;
58
+ /**
59
+ * The unsigned addresses they are listening on. Note - any multiaddrs present
60
+ * in the signed peer record should be preferred to the value here.
61
+ */
62
+ listenAddrs: Multiaddr[];
63
+ /**
64
+ * The protocols the remote peer supports
65
+ */
66
+ protocols: string[];
67
+ /**
68
+ * The remote protocol version
69
+ */
70
+ protocolVersion?: string;
71
+ /**
72
+ * The remote agent version
73
+ */
74
+ agentVersion?: string;
75
+ /**
76
+ * The public key part of the remote PeerId - this is only useful for older
77
+ * RSA-based PeerIds, the more modern Ed25519 and secp256k1 types have the
78
+ * public key embedded in them
79
+ */
80
+ publicKey?: Uint8Array;
81
+ /**
82
+ * If set this is the address that the remote peer saw the identify request
83
+ * originate from
84
+ */
85
+ observedAddr?: Multiaddr;
86
+ /**
87
+ * If sent by the remote peer this is the deserialized signed peer record
88
+ */
89
+ signedPeerRecord?: SignedPeerRecord;
90
+ }
91
+ /**
92
+ * Once you have a libp2p instance, you can listen to several events it emits,
93
+ * so that you can be notified of relevant network events.
94
+ *
95
+ * Event names are `noun:verb` so the first part is the name of the object
96
+ * being acted on and the second is the action.
97
+ */
98
+ export interface Libp2pEvents<T extends ServiceMap = ServiceMap> {
99
+ /**
100
+ * This event is dispatched when a new network peer is discovered.
101
+ *
102
+ * @example
103
+ *
104
+ * ```js
105
+ * libp2p.addEventListener('peer:discovery', (event) => {
106
+ * const peerInfo = event.detail
107
+ * // ...
108
+ * })
109
+ * ```
110
+ */
111
+ 'peer:discovery': CustomEvent<PeerInfo>;
112
+ /**
113
+ * This event will be triggered any time a new peer connects.
114
+ *
115
+ * @example
116
+ *
117
+ * ```js
118
+ * libp2p.addEventListener('peer:connect', (event) => {
119
+ * const peerId = event.detail
120
+ * // ...
121
+ * })
122
+ * ```
123
+ */
124
+ 'peer:connect': CustomEvent<PeerId>;
125
+ /**
126
+ * This event will be triggered any time we are disconnected from another peer, regardless of
127
+ * the circumstances of that disconnection. If we happen to have multiple connections to a
128
+ * peer, this event will **only** be triggered when the last connection is closed.
129
+ *
130
+ * @example
131
+ *
132
+ * ```js
133
+ * libp2p.addEventListener('peer:disconnect', (event) => {
134
+ * const peerId = event.detail
135
+ * // ...
136
+ * })
137
+ * ```
138
+ */
139
+ 'peer:disconnect': CustomEvent<PeerId>;
140
+ /**
141
+ * This event is dispatched after a remote peer has successfully responded to the identify
142
+ * protocol. Note that for this to be emitted, both peers must have an identify service
143
+ * configured.
144
+ *
145
+ * @example
146
+ *
147
+ * ```js
148
+ * libp2p.addEventListener('peer:identify', (event) => {
149
+ * const identifyResult = event.detail
150
+ * // ...
151
+ * })
152
+ * ```
153
+ */
154
+ 'peer:identify': CustomEvent<IdentifyResult>;
155
+ /**
156
+ * This event is dispatched when the peer store data for a peer has been
157
+ * updated - e.g. their multiaddrs, protocols etc have changed.
158
+ *
159
+ * If they were previously known to this node, the old peer data will be
160
+ * set in the `previous` field.
161
+ *
162
+ * This may be in response to the identify protocol running, a manual
163
+ * update or some other event.
164
+ */
165
+ 'peer:update': CustomEvent<PeerUpdate>;
166
+ /**
167
+ * This event is dispatched when the current node's peer record changes -
168
+ * for example a transport started listening on a new address or a new
169
+ * protocol handler was registered.
170
+ *
171
+ * @example
172
+ *
173
+ * ```js
174
+ * libp2p.addEventListener('self:peer:update', (event) => {
175
+ * const { peer } = event.detail
176
+ * // ...
177
+ * })
178
+ * ```
179
+ */
180
+ 'self:peer:update': CustomEvent<PeerUpdate>;
181
+ /**
182
+ * This event is dispatched when a transport begins listening on a new address
183
+ */
184
+ 'transport:listening': CustomEvent<Listener>;
185
+ /**
186
+ * This event is dispatched when a transport stops listening on an address
187
+ */
188
+ 'transport:close': CustomEvent<Listener>;
189
+ /**
190
+ * This event is dispatched when the connection manager has more than the
191
+ * configured allowable max connections and has closed some connections to
192
+ * bring the node back under the limit.
193
+ */
194
+ 'connection:prune': CustomEvent<Connection[]>;
195
+ /**
196
+ * This event notifies listeners when new incoming or outgoing connections
197
+ * are opened.
198
+ */
199
+ 'connection:open': CustomEvent<Connection>;
200
+ /**
201
+ * This event notifies listeners when incoming or outgoing connections are
202
+ * closed.
203
+ */
204
+ 'connection:close': CustomEvent<Connection>;
205
+ /**
206
+ * This event notifies listeners that the node has started
207
+ *
208
+ * ```js
209
+ * libp2p.addEventListener('start', (event) => {
210
+ * console.info(libp2p.isStarted()) // true
211
+ * })
212
+ * ```
213
+ */
214
+ 'start': CustomEvent<Libp2p<T>>;
215
+ /**
216
+ * This event notifies listeners that the node has stopped
217
+ *
218
+ * ```js
219
+ * libp2p.addEventListener('stop', (event) => {
220
+ * console.info(libp2p.isStarted()) // false
221
+ * })
222
+ * ```
223
+ */
224
+ 'stop': CustomEvent<Libp2p<T>>;
225
+ }
226
+ /**
227
+ * A map of user defined services available on the libp2p node via the
228
+ * `services` key
229
+ *
230
+ * @example
231
+ *
232
+ * ```js
233
+ * const node = await createLibp2p({
234
+ * // ...other options
235
+ * services: {
236
+ * myService: myService({
237
+ * // ...service options
238
+ * })
239
+ * }
240
+ * })
241
+ *
242
+ * // invoke methods on the service
243
+ * node.services.myService.anOperation()
244
+ * ```
245
+ */
246
+ export type ServiceMap = Record<string, unknown>;
247
+ export type PendingDialStatus = 'queued' | 'active' | 'error' | 'success';
248
+ /**
249
+ * An item in the dial queue
250
+ */
251
+ export interface PendingDial {
252
+ /**
253
+ * A unique identifier for this dial
254
+ */
255
+ id: string;
256
+ /**
257
+ * The current status of the dial
258
+ */
259
+ status: PendingDialStatus;
260
+ /**
261
+ * If known, this is the peer id that libp2p expects to be dialling
262
+ */
263
+ peerId?: PeerId;
264
+ /**
265
+ * The list of multiaddrs that will be dialled. The returned connection will
266
+ * use the first address that succeeds, all other dials part of this pending
267
+ * dial will be cancelled.
268
+ */
269
+ multiaddrs: Multiaddr[];
270
+ }
271
+ /**
272
+ * Libp2p nodes implement this interface.
273
+ */
274
+ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, EventEmitter<Libp2pEvents<T>> {
275
+ /**
276
+ * The PeerId is a unique identifier for a node on the network.
277
+ *
278
+ * It is the hash of an RSA public key or, for Ed25519 or secp256k1 keys,
279
+ * the key itself.
280
+ *
281
+ * @example
282
+ *
283
+ * ```js
284
+ * console.info(libp2p.peerId)
285
+ * // PeerId(12D3Foo...)
286
+ * ````
287
+ */
288
+ peerId: PeerId;
289
+ /**
290
+ * The peer store holds information we know about other peers on the network.
291
+ * - multiaddrs, supported protocols, etc.
292
+ *
293
+ * @example
294
+ *
295
+ * ```js
296
+ * const peer = await libp2p.peerStore.get(peerId)
297
+ * console.info(peer)
298
+ * // { id: PeerId(12D3Foo...), addresses: [] ... }
299
+ * ```
300
+ */
301
+ peerStore: PeerStore;
302
+ /**
303
+ * The peer routing subsystem allows the user to find peers on the network
304
+ * or to find peers close to binary keys.
305
+ *
306
+ * @example
307
+ *
308
+ * ```js
309
+ * const peerInfo = await libp2p.peerRouting.findPeer(peerId)
310
+ * console.info(peerInfo)
311
+ * // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
312
+ * ```
313
+ *
314
+ * @example
315
+ *
316
+ * ```js
317
+ * for await (const peerInfo of libp2p.peerRouting.getClosestPeers(key)) {
318
+ * console.info(peerInfo)
319
+ * // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
320
+ * }
321
+ * ```
322
+ */
323
+ peerRouting: PeerRouting;
324
+ /**
325
+ * The content routing subsystem allows the user to find providers for content,
326
+ * let the network know they are providers for content, and get/put values to
327
+ * the DHT.
328
+ *
329
+ * @example
330
+ *
331
+ * ```js
332
+ * for await (const peerInfo of libp2p.contentRouting.findProviders(cid)) {
333
+ * console.info(peerInfo)
334
+ * // { id: PeerId(12D3Foo...), multiaddrs: [] ... }
335
+ * }
336
+ * ```
337
+ */
338
+ contentRouting: ContentRouting;
339
+ /**
340
+ * The keychain contains the keys used by the current node, and can create new
341
+ * keys, export them, import them, etc.
342
+ *
343
+ * @example
344
+ *
345
+ * ```js
346
+ * const keyInfo = await libp2p.keychain.createKey('new key')
347
+ * console.info(keyInfo)
348
+ * // { id: '...', name: 'new key' }
349
+ * ```
350
+ */
351
+ keychain: KeyChain;
352
+ /**
353
+ * The metrics subsystem allows recording values to assess the health/performance
354
+ * of the running node.
355
+ *
356
+ * @example
357
+ *
358
+ * ```js
359
+ * const metric = libp2p.metrics.registerMetric({
360
+ * 'my-metric'
361
+ * })
362
+ *
363
+ * // later
364
+ * metric.update(5)
365
+ * ```
366
+ */
367
+ metrics?: Metrics;
368
+ /**
369
+ * Get a deduplicated list of peer advertising multiaddrs by concatenating
370
+ * the listen addresses used by transports with any configured
371
+ * announce addresses as well as observed addresses reported by peers.
372
+ *
373
+ * If Announce addrs are specified, configured listen addresses will be
374
+ * ignored though observed addresses will still be included.
375
+ *
376
+ * @example
377
+ *
378
+ * ```js
379
+ * const listenMa = libp2p.getMultiaddrs()
380
+ * // [ <Multiaddr 047f00000106f9ba - /ip4/127.0.0.1/tcp/63930> ]
381
+ * ```
382
+ */
383
+ getMultiaddrs: () => Multiaddr[];
384
+ /**
385
+ * Returns a list of supported protocols
386
+ *
387
+ * @example
388
+ *
389
+ * ```js
390
+ * const protocols = libp2p.getProtocols()
391
+ * // [ '/ipfs/ping/1.0.0', '/ipfs/id/1.0.0' ]
392
+ * ```
393
+ */
394
+ getProtocols: () => string[];
395
+ /**
396
+ * Return a list of all connections this node has open, optionally filtering
397
+ * by a PeerId
398
+ *
399
+ * @example
400
+ *
401
+ * ```js
402
+ * for (const connection of libp2p.getConnections()) {
403
+ * console.log(peerId, connection.remoteAddr.toString())
404
+ * // Logs the PeerId string and the observed remote multiaddr of each Connection
405
+ * }
406
+ * ```
407
+ */
408
+ getConnections: (peerId?: PeerId) => Connection[];
409
+ /**
410
+ * Return the list of dials currently in progress or queued to start
411
+ *
412
+ * @example
413
+ *
414
+ * ```js
415
+ * for (const pendingDial of libp2p.getDialQueue()) {
416
+ * console.log(pendingDial)
417
+ * }
418
+ * ```
419
+ */
420
+ getDialQueue: () => PendingDial[];
421
+ /**
422
+ * Return a list of all peers we currently have a connection open to
423
+ */
424
+ getPeers: () => PeerId[];
425
+ /**
426
+ * Dials to the provided peer. If successful, the known metadata of the
427
+ * peer will be added to the nodes `peerStore`.
428
+ *
429
+ * If a PeerId is passed as the first argument, the peer will need to have known multiaddrs for it in the PeerStore.
430
+ *
431
+ * @example
432
+ *
433
+ * ```js
434
+ * const conn = await libp2p.dial(remotePeerId)
435
+ *
436
+ * // create a new stream within the connection
437
+ * const { stream, protocol } = await conn.newStream(['/echo/1.1.0', '/echo/1.0.0'])
438
+ *
439
+ * // protocol negotiated: 'echo/1.0.0' means that the other party only supports the older version
440
+ *
441
+ * // ...
442
+ * await conn.close()
443
+ * ```
444
+ */
445
+ dial: (peer: PeerId | Multiaddr | Multiaddr[], options?: AbortOptions) => Promise<Connection>;
446
+ /**
447
+ * Dials to the provided peer and tries to handshake with the given protocols in order.
448
+ * If successful, the known metadata of the peer will be added to the nodes `peerStore`,
449
+ * and the `MuxedStream` will be returned together with the successful negotiated protocol.
450
+ *
451
+ * @example
452
+ *
453
+ * ```js
454
+ * import { pipe } from 'it-pipe'
455
+ *
456
+ * const { stream, protocol } = await libp2p.dialProtocol(remotePeerId, protocols)
457
+ *
458
+ * // Use this new stream like any other duplex stream
459
+ * pipe([1, 2, 3], stream, consume)
460
+ * ```
461
+ */
462
+ dialProtocol: (peer: PeerId | Multiaddr | Multiaddr[], protocols: string | string[], options?: AbortOptions) => Promise<Stream>;
463
+ /**
464
+ * Attempts to gracefully close an open connection to the given peer. If the connection is not closed in the grace period, it will be forcefully closed.
465
+ *
466
+ * @example
467
+ *
468
+ * ```js
469
+ * await libp2p.hangUp(remotePeerId)
470
+ * ```
471
+ */
472
+ hangUp: (peer: PeerId | Multiaddr) => Promise<void>;
473
+ /**
474
+ * Sets up [multistream-select routing](https://github.com/multiformats/multistream-select) of protocols to their application handlers. Whenever a stream is opened on one of the provided protocols, the handler will be called. `handle` must be called in order to register a handler and support for a given protocol. This also informs other peers of the protocols you support.
475
+ *
476
+ * `libp2p.handle(protocols, handler, options)`
477
+ *
478
+ * In the event of a new handler for the same protocol being added, the first one is discarded.
479
+ *
480
+ * @example
481
+ *
482
+ * ```js
483
+ * const handler = ({ connection, stream, protocol }) => {
484
+ * // use stream or connection according to the needs
485
+ * }
486
+ *
487
+ * libp2p.handle('/echo/1.0.0', handler, {
488
+ * maxInboundStreams: 5,
489
+ * maxOutboundStreams: 5
490
+ * })
491
+ * ```
492
+ */
493
+ handle: (protocol: string | string[], handler: StreamHandler, options?: StreamHandlerOptions) => Promise<void>;
494
+ /**
495
+ * Removes the handler for each protocol. The protocol
496
+ * will no longer be supported on streams.
497
+ *
498
+ * @example
499
+ *
500
+ * ```js
501
+ * libp2p.unhandle(['/echo/1.0.0'])
502
+ * ```
503
+ */
504
+ unhandle: (protocols: string[] | string) => Promise<void>;
505
+ /**
506
+ * Register a topology to be informed when peers are encountered that
507
+ * support the specified protocol
508
+ *
509
+ * @example
510
+ *
511
+ * ```js
512
+ * const id = await libp2p.register('/echo/1.0.0', {
513
+ * onConnect: (peer, connection) => {
514
+ * // handle connect
515
+ * },
516
+ * onDisconnect: (peer, connection) => {
517
+ * // handle disconnect
518
+ * }
519
+ * })
520
+ * ```
521
+ */
522
+ register: (protocol: string, topology: Topology) => Promise<string>;
523
+ /**
524
+ * Unregister topology to no longer be informed when peers connect or
525
+ * disconnect.
526
+ *
527
+ * @example
528
+ *
529
+ * ```js
530
+ * const id = await libp2p.register(...)
531
+ *
532
+ * libp2p.unregister(id)
533
+ * ```
534
+ */
535
+ unregister: (id: string) => void;
536
+ /**
537
+ * Returns the public key for the passed PeerId. If the PeerId is of the 'RSA' type
538
+ * this may mean searching the DHT if the key is not present in the KeyStore.
539
+ * A set of user defined services
540
+ */
541
+ getPublicKey: (peer: PeerId, options?: AbortOptions) => Promise<Uint8Array>;
542
+ /**
543
+ * A set of user defined services
544
+ */
545
+ services: T;
546
+ }
547
+ /**
548
+ * An object that contains an AbortSignal as
549
+ * the optional `signal` property.
550
+ *
551
+ * @example
552
+ *
553
+ * ```js
554
+ * const controller = new AbortController()
555
+ *
556
+ * aLongRunningOperation({
557
+ * signal: controller.signal
558
+ * })
559
+ *
560
+ * // later
561
+ *
562
+ * controller.abort()
563
+ */
564
+ export interface AbortOptions {
565
+ signal?: AbortSignal;
566
+ }
567
+ /**
568
+ * Returns a new type with all fields marked optional.
569
+ *
570
+ * Borrowed from the tsdef module.
571
+ */
572
+ export type RecursivePartial<T> = {
573
+ [P in keyof T]?: T[P] extends Array<infer I> ? Array<RecursivePartial<I>> : T[P] extends (...args: any[]) => any ? T[P] : RecursivePartial<T[P]>;
574
+ };
575
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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