libp2p 0.46.14 → 0.46.15
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/index.min.js +33 -33
- package/dist/src/address-manager/index.d.ts +2 -2
- package/dist/src/address-manager/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/index.d.ts +2 -2
- package/dist/src/circuit-relay/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/advert-service.d.ts +2 -2
- package/dist/src/circuit-relay/server/advert-service.d.ts.map +1 -1
- package/dist/src/circuit-relay/server/advert-service.js +2 -2
- package/dist/src/circuit-relay/server/advert-service.js.map +1 -1
- package/dist/src/circuit-relay/server/index.js +2 -2
- package/dist/src/circuit-relay/server/index.js.map +1 -1
- package/dist/src/circuit-relay/transport/discovery.d.ts +2 -2
- package/dist/src/circuit-relay/transport/discovery.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/discovery.js +2 -2
- package/dist/src/circuit-relay/transport/discovery.js.map +1 -1
- package/dist/src/circuit-relay/transport/index.d.ts +2 -2
- package/dist/src/circuit-relay/transport/index.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/listener.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/listener.js +8 -5
- package/dist/src/circuit-relay/transport/listener.js.map +1 -1
- package/dist/src/circuit-relay/transport/reservation-store.d.ts +3 -3
- package/dist/src/circuit-relay/transport/reservation-store.d.ts.map +1 -1
- package/dist/src/circuit-relay/transport/reservation-store.js +2 -2
- package/dist/src/circuit-relay/transport/reservation-store.js.map +1 -1
- package/dist/src/components.d.ts +3 -3
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/connection-manager/auto-dial.d.ts +2 -2
- package/dist/src/connection-manager/auto-dial.d.ts.map +1 -1
- package/dist/src/connection-manager/connection-pruner.d.ts +2 -2
- package/dist/src/connection-manager/connection-pruner.d.ts.map +1 -1
- package/dist/src/connection-manager/connection-pruner.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +2 -2
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/identify/consts.d.ts +1 -1
- package/dist/src/identify/identify.d.ts.map +1 -1
- package/dist/src/identify/identify.js.map +1 -1
- package/dist/src/identify/index.d.ts +2 -2
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/libp2p.d.ts +2 -2
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +3 -3
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/registrar.d.ts +2 -2
- package/dist/src/registrar.d.ts.map +1 -1
- package/dist/src/transport-manager.d.ts +2 -2
- package/dist/src/transport-manager.d.ts.map +1 -1
- package/dist/src/upgrader.d.ts +2 -2
- package/dist/src/upgrader.d.ts.map +1 -1
- package/dist/src/upgrader.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +3 -3
- package/src/address-manager/index.ts +2 -2
- package/src/circuit-relay/index.ts +2 -2
- package/src/circuit-relay/server/advert-service.ts +2 -2
- package/src/circuit-relay/server/index.ts +2 -2
- package/src/circuit-relay/transport/discovery.ts +2 -2
- package/src/circuit-relay/transport/index.ts +2 -2
- package/src/circuit-relay/transport/listener.ts +9 -5
- package/src/circuit-relay/transport/reservation-store.ts +4 -4
- package/src/components.ts +3 -3
- package/src/connection-manager/auto-dial.ts +2 -2
- package/src/connection-manager/connection-pruner.ts +3 -3
- package/src/connection-manager/index.ts +3 -3
- package/src/identify/identify.ts +2 -2
- package/src/identify/index.ts +2 -2
- package/src/libp2p.ts +3 -3
- package/src/registrar.ts +2 -2
- package/src/transport-manager.ts +2 -2
- package/src/upgrader.ts +3 -3
- package/src/version.ts +1 -1
|
@@ -17,7 +17,7 @@ import type { Libp2pEvents, AbortOptions } from '@libp2p/interface'
|
|
|
17
17
|
import type { Connection, Stream } from '@libp2p/interface/connection'
|
|
18
18
|
import type { ConnectionGater } from '@libp2p/interface/connection-gater'
|
|
19
19
|
import type { ContentRouting } from '@libp2p/interface/content-routing'
|
|
20
|
-
import type {
|
|
20
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
21
21
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
22
22
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
23
23
|
import type { AddressManager } from '@libp2p/interface-internal/address-manager'
|
|
@@ -50,7 +50,7 @@ export interface CircuitRelayTransportComponents extends RelayDiscoveryComponent
|
|
|
50
50
|
addressManager: AddressManager
|
|
51
51
|
contentRouting: ContentRouting
|
|
52
52
|
connectionGater: ConnectionGater
|
|
53
|
-
events:
|
|
53
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
interface ConnectOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CodeError } from '@libp2p/interface/errors'
|
|
2
|
-
import {
|
|
2
|
+
import { TypedEventEmitter } from '@libp2p/interface/events'
|
|
3
3
|
import { logger } from '@libp2p/logger'
|
|
4
4
|
import { PeerMap } from '@libp2p/peer-collections'
|
|
5
5
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
@@ -18,7 +18,7 @@ export interface CircuitRelayTransportListenerComponents {
|
|
|
18
18
|
relayStore: ReservationStore
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
class CircuitRelayTransportListener extends
|
|
21
|
+
class CircuitRelayTransportListener extends TypedEventEmitter<ListenerEvents> implements Listener {
|
|
22
22
|
private readonly connectionManager: ConnectionManager
|
|
23
23
|
private readonly relayStore: ReservationStore
|
|
24
24
|
private readonly listeningAddrs: PeerMap<Multiaddr[]>
|
|
@@ -31,9 +31,11 @@ class CircuitRelayTransportListener extends EventEmitter<ListenerEvents> impleme
|
|
|
31
31
|
this.listeningAddrs = new PeerMap()
|
|
32
32
|
|
|
33
33
|
// remove listening addrs when a relay is removed
|
|
34
|
-
this.relayStore.addEventListener('relay:removed',
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
this.relayStore.addEventListener('relay:removed', this._onRemoveRelayPeer)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_onRemoveRelayPeer = (evt: CustomEvent<PeerId>): void => {
|
|
38
|
+
this.#removeRelayPeer(evt.detail)
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
async listen (addr: Multiaddr): Promise<void> {
|
|
@@ -100,6 +102,8 @@ class CircuitRelayTransportListener extends EventEmitter<ListenerEvents> impleme
|
|
|
100
102
|
this.listeningAddrs.delete(peerId)
|
|
101
103
|
|
|
102
104
|
if (had) {
|
|
105
|
+
log.trace('removing relay event listener for peer %p', peerId)
|
|
106
|
+
this.relayStore.removeEventListener('relay:removed', this._onRemoveRelayPeer)
|
|
103
107
|
// Announce listen addresses change
|
|
104
108
|
this.safeDispatchEvent('close', {})
|
|
105
109
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TypedEventEmitter, type TypedEventTarget } from '@libp2p/interface/events'
|
|
2
2
|
import { logger } from '@libp2p/logger'
|
|
3
3
|
import { PeerMap } from '@libp2p/peer-collections'
|
|
4
4
|
import { multiaddr } from '@multiformats/multiaddr'
|
|
@@ -32,7 +32,7 @@ export interface RelayStoreComponents {
|
|
|
32
32
|
connectionManager: ConnectionManager
|
|
33
33
|
transportManager: TransportManager
|
|
34
34
|
peerStore: PeerStore
|
|
35
|
-
events:
|
|
35
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface RelayStoreInit {
|
|
@@ -76,12 +76,12 @@ export interface ReservationStoreEvents {
|
|
|
76
76
|
'relay:removed': CustomEvent<PeerId>
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export class ReservationStore extends
|
|
79
|
+
export class ReservationStore extends TypedEventEmitter<ReservationStoreEvents> implements Startable {
|
|
80
80
|
private readonly peerId: PeerId
|
|
81
81
|
private readonly connectionManager: ConnectionManager
|
|
82
82
|
private readonly transportManager: TransportManager
|
|
83
83
|
private readonly peerStore: PeerStore
|
|
84
|
-
private readonly events:
|
|
84
|
+
private readonly events: TypedEventTarget<Libp2pEvents>
|
|
85
85
|
private readonly reserveQueue: PeerJobQueue
|
|
86
86
|
private readonly reservations: PeerMap<RelayEntry>
|
|
87
87
|
private readonly maxDiscoveredRelays: number
|
package/src/components.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Libp2pEvents } from '@libp2p/interface'
|
|
|
4
4
|
import type { ConnectionProtector } from '@libp2p/interface/connection'
|
|
5
5
|
import type { ConnectionGater } from '@libp2p/interface/connection-gater'
|
|
6
6
|
import type { ContentRouting } from '@libp2p/interface/content-routing'
|
|
7
|
-
import type {
|
|
7
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
8
8
|
import type { Metrics } from '@libp2p/interface/metrics'
|
|
9
9
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
10
10
|
import type { PeerRouting } from '@libp2p/interface/peer-routing'
|
|
@@ -18,7 +18,7 @@ import type { Datastore } from 'interface-datastore'
|
|
|
18
18
|
|
|
19
19
|
export interface Components extends Record<string, any>, Startable {
|
|
20
20
|
peerId: PeerId
|
|
21
|
-
events:
|
|
21
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
22
22
|
addressManager: AddressManager
|
|
23
23
|
peerStore: PeerStore
|
|
24
24
|
upgrader: Upgrader
|
|
@@ -35,7 +35,7 @@ export interface Components extends Record<string, any>, Startable {
|
|
|
35
35
|
|
|
36
36
|
export interface ComponentsInit {
|
|
37
37
|
peerId?: PeerId
|
|
38
|
-
events?:
|
|
38
|
+
events?: TypedEventTarget<Libp2pEvents>
|
|
39
39
|
addressManager?: AddressManager
|
|
40
40
|
peerStore?: PeerStore
|
|
41
41
|
upgrader?: Upgrader
|
|
@@ -4,7 +4,7 @@ import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
|
4
4
|
import { PeerJobQueue } from '../utils/peer-job-queue.js'
|
|
5
5
|
import { AUTO_DIAL_CONCURRENCY, AUTO_DIAL_DISCOVERED_PEERS_DEBOUNCE, AUTO_DIAL_INTERVAL, AUTO_DIAL_MAX_QUEUE_LENGTH, AUTO_DIAL_PEER_RETRY_THRESHOLD, AUTO_DIAL_PRIORITY, LAST_DIAL_FAILURE_KEY, MIN_CONNECTIONS } from './constants.js'
|
|
6
6
|
import type { Libp2pEvents } from '@libp2p/interface'
|
|
7
|
-
import type {
|
|
7
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
8
8
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
9
9
|
import type { Startable } from '@libp2p/interface/startable'
|
|
10
10
|
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
|
|
@@ -24,7 +24,7 @@ interface AutoDialInit {
|
|
|
24
24
|
interface AutoDialComponents {
|
|
25
25
|
connectionManager: ConnectionManager
|
|
26
26
|
peerStore: PeerStore
|
|
27
|
-
events:
|
|
27
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
const defaultOptions = {
|
|
@@ -2,7 +2,7 @@ import { logger } from '@libp2p/logger'
|
|
|
2
2
|
import { PeerMap } from '@libp2p/peer-collections'
|
|
3
3
|
import { MAX_CONNECTIONS } from './constants.js'
|
|
4
4
|
import type { Libp2pEvents } from '@libp2p/interface'
|
|
5
|
-
import type {
|
|
5
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
6
6
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
7
7
|
import type { ConnectionManager } from '@libp2p/interface-internal/connection-manager'
|
|
8
8
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
@@ -17,7 +17,7 @@ interface ConnectionPrunerInit {
|
|
|
17
17
|
interface ConnectionPrunerComponents {
|
|
18
18
|
connectionManager: ConnectionManager
|
|
19
19
|
peerStore: PeerStore
|
|
20
|
-
events:
|
|
20
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const defaultOptions = {
|
|
@@ -33,7 +33,7 @@ export class ConnectionPruner {
|
|
|
33
33
|
private readonly connectionManager: ConnectionManager
|
|
34
34
|
private readonly peerStore: PeerStore
|
|
35
35
|
private readonly allow: Multiaddr[]
|
|
36
|
-
private readonly events:
|
|
36
|
+
private readonly events: TypedEventTarget<Libp2pEvents>
|
|
37
37
|
|
|
38
38
|
constructor (components: ConnectionPrunerComponents, init: ConnectionPrunerInit = {}) {
|
|
39
39
|
this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections
|
|
@@ -15,7 +15,7 @@ import { DialQueue } from './dial-queue.js'
|
|
|
15
15
|
import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions } from '@libp2p/interface'
|
|
16
16
|
import type { Connection, MultiaddrConnection } from '@libp2p/interface/connection'
|
|
17
17
|
import type { ConnectionGater } from '@libp2p/interface/connection-gater'
|
|
18
|
-
import type {
|
|
18
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
19
19
|
import type { Metrics } from '@libp2p/interface/metrics'
|
|
20
20
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
21
21
|
import type { Peer, PeerStore } from '@libp2p/interface/peer-store'
|
|
@@ -165,7 +165,7 @@ export interface DefaultConnectionManagerComponents {
|
|
|
165
165
|
peerStore: PeerStore
|
|
166
166
|
transportManager: TransportManager
|
|
167
167
|
connectionGater: ConnectionGater
|
|
168
|
-
events:
|
|
168
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
/**
|
|
@@ -187,7 +187,7 @@ export class DefaultConnectionManager implements ConnectionManager, Startable {
|
|
|
187
187
|
|
|
188
188
|
private readonly peerStore: PeerStore
|
|
189
189
|
private readonly metrics?: Metrics
|
|
190
|
-
private readonly events:
|
|
190
|
+
private readonly events: TypedEventTarget<Libp2pEvents>
|
|
191
191
|
|
|
192
192
|
constructor (components: DefaultConnectionManagerComponents, init: ConnectionManagerInit = {}) {
|
|
193
193
|
this.maxConnections = init.maxConnections ?? defaultOptions.maxConnections
|
package/src/identify/identify.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { Identify } from './pb/message.js'
|
|
|
21
21
|
import type { IdentifyService, IdentifyServiceComponents, IdentifyServiceInit } from './index.js'
|
|
22
22
|
import type { Libp2pEvents, IdentifyResult, SignedPeerRecord, AbortOptions } from '@libp2p/interface'
|
|
23
23
|
import type { Connection, Stream } from '@libp2p/interface/connection'
|
|
24
|
-
import type {
|
|
24
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
25
25
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
26
26
|
import type { Peer, PeerStore } from '@libp2p/interface/peer-store'
|
|
27
27
|
import type { Startable } from '@libp2p/interface/startable'
|
|
@@ -70,7 +70,7 @@ export class DefaultIdentifyService implements Startable, IdentifyService {
|
|
|
70
70
|
private readonly maxPushOutgoingStreams: number
|
|
71
71
|
private readonly maxIdentifyMessageSize: number
|
|
72
72
|
private readonly maxObservedAddresses: number
|
|
73
|
-
private readonly events:
|
|
73
|
+
private readonly events: TypedEventTarget<Libp2pEvents>
|
|
74
74
|
private readonly runOnTransientConnection: boolean
|
|
75
75
|
|
|
76
76
|
constructor (components: IdentifyServiceComponents, init: IdentifyServiceInit) {
|
package/src/identify/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import { DefaultIdentifyService } from './identify.js'
|
|
6
6
|
import { Identify } from './pb/message.js'
|
|
7
7
|
import type { AbortOptions, IdentifyResult, Libp2pEvents } from '@libp2p/interface'
|
|
8
|
-
import type {
|
|
8
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
9
9
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
10
10
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
11
11
|
import type { Connection } from '@libp2p/interface/src/connection/index.js'
|
|
@@ -58,7 +58,7 @@ export interface IdentifyServiceComponents {
|
|
|
58
58
|
connectionManager: ConnectionManager
|
|
59
59
|
registrar: Registrar
|
|
60
60
|
addressManager: AddressManager
|
|
61
|
-
events:
|
|
61
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
package/src/libp2p.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { setMaxListeners } from 'events'
|
|
|
2
2
|
import { unmarshalPublicKey } from '@libp2p/crypto/keys'
|
|
3
3
|
import { type ContentRouting, contentRouting } from '@libp2p/interface/content-routing'
|
|
4
4
|
import { CodeError } from '@libp2p/interface/errors'
|
|
5
|
-
import {
|
|
5
|
+
import { TypedEventEmitter, CustomEvent } from '@libp2p/interface/events'
|
|
6
6
|
import { peerDiscovery } from '@libp2p/interface/peer-discovery'
|
|
7
7
|
import { type PeerRouting, peerRouting } from '@libp2p/interface/peer-routing'
|
|
8
8
|
import { DefaultKeyChain } from '@libp2p/keychain'
|
|
@@ -42,7 +42,7 @@ import type { Datastore } from 'interface-datastore'
|
|
|
42
42
|
|
|
43
43
|
const log = logger('libp2p')
|
|
44
44
|
|
|
45
|
-
export class Libp2pNode<T extends ServiceMap = Record<string, unknown>> extends
|
|
45
|
+
export class Libp2pNode<T extends ServiceMap = Record<string, unknown>> extends TypedEventEmitter<Libp2pEvents> implements Libp2p<T> {
|
|
46
46
|
public peerId: PeerId
|
|
47
47
|
public peerStore: PeerStore
|
|
48
48
|
public contentRouting: ContentRouting
|
|
@@ -59,7 +59,7 @@ export class Libp2pNode<T extends ServiceMap = Record<string, unknown>> extends
|
|
|
59
59
|
|
|
60
60
|
// event bus - components can listen to this emitter to be notified of system events
|
|
61
61
|
// and also cause them to be emitted
|
|
62
|
-
const events = new
|
|
62
|
+
const events = new TypedEventEmitter<Libp2pEvents>()
|
|
63
63
|
const originalDispatch = events.dispatchEvent.bind(events)
|
|
64
64
|
events.dispatchEvent = (evt: any) => {
|
|
65
65
|
const internalResult = originalDispatch(evt)
|
package/src/registrar.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { logger } from '@libp2p/logger'
|
|
|
3
3
|
import merge from 'merge-options'
|
|
4
4
|
import { codes } from './errors.js'
|
|
5
5
|
import type { Libp2pEvents, PeerUpdate } from '@libp2p/interface'
|
|
6
|
-
import type {
|
|
6
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
7
7
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
8
8
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
9
9
|
import type { Topology } from '@libp2p/interface/topology'
|
|
@@ -19,7 +19,7 @@ export interface RegistrarComponents {
|
|
|
19
19
|
peerId: PeerId
|
|
20
20
|
connectionManager: ConnectionManager
|
|
21
21
|
peerStore: PeerStore
|
|
22
|
-
events:
|
|
22
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
package/src/transport-manager.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { logger } from '@libp2p/logger'
|
|
|
5
5
|
import { codes } from './errors.js'
|
|
6
6
|
import type { Libp2pEvents, AbortOptions } from '@libp2p/interface'
|
|
7
7
|
import type { Connection } from '@libp2p/interface/connection'
|
|
8
|
-
import type {
|
|
8
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
9
9
|
import type { Metrics } from '@libp2p/interface/metrics'
|
|
10
10
|
import type { Startable } from '@libp2p/interface/startable'
|
|
11
11
|
import type { Listener, Transport, Upgrader } from '@libp2p/interface/transport'
|
|
@@ -23,7 +23,7 @@ export interface DefaultTransportManagerComponents {
|
|
|
23
23
|
metrics?: Metrics
|
|
24
24
|
addressManager: AddressManager
|
|
25
25
|
upgrader: Upgrader
|
|
26
|
-
events:
|
|
26
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export class DefaultTransportManager implements TransportManager, Startable {
|
package/src/upgrader.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { Libp2pEvents, AbortOptions } from '@libp2p/interface'
|
|
|
11
11
|
import type { MultiaddrConnection, Connection, Stream, ConnectionProtector, NewStreamOptions } from '@libp2p/interface/connection'
|
|
12
12
|
import type { ConnectionEncrypter, SecuredConnection } from '@libp2p/interface/connection-encrypter'
|
|
13
13
|
import type { ConnectionGater } from '@libp2p/interface/connection-gater'
|
|
14
|
-
import type {
|
|
14
|
+
import type { TypedEventTarget } from '@libp2p/interface/events'
|
|
15
15
|
import type { Metrics } from '@libp2p/interface/metrics'
|
|
16
16
|
import type { PeerId } from '@libp2p/interface/peer-id'
|
|
17
17
|
import type { PeerStore } from '@libp2p/interface/peer-store'
|
|
@@ -104,7 +104,7 @@ export interface DefaultUpgraderComponents {
|
|
|
104
104
|
connectionProtector?: ConnectionProtector
|
|
105
105
|
registrar: Registrar
|
|
106
106
|
peerStore: PeerStore
|
|
107
|
-
events:
|
|
107
|
+
events: TypedEventTarget<Libp2pEvents>
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
type EncryptedConn = Duplex<AsyncGenerator<Uint8Array, any, unknown>, Source<Uint8Array>, Promise<void>>
|
|
@@ -116,7 +116,7 @@ export class DefaultUpgrader implements Upgrader {
|
|
|
116
116
|
private readonly connectionEncryption: Map<string, ConnectionEncrypter>
|
|
117
117
|
private readonly muxers: Map<string, StreamMuxerFactory>
|
|
118
118
|
private readonly inboundUpgradeTimeout: number
|
|
119
|
-
private readonly events:
|
|
119
|
+
private readonly events: TypedEventTarget<Libp2pEvents>
|
|
120
120
|
|
|
121
121
|
constructor (components: DefaultUpgraderComponents, init: UpgraderInit) {
|
|
122
122
|
this.components = components
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '0.46.
|
|
1
|
+
export const version = '0.46.15'
|
|
2
2
|
export const name = 'libp2p'
|