@libp2p/interface 1.5.0 → 1.6.0
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/peer-id/index.d.ts +3 -0
- package/dist/src/peer-id/index.d.ts.map +1 -1
- package/dist/src/peer-id/index.js.map +1 -1
- package/dist/src/transport/index.d.ts +10 -7
- package/dist/src/transport/index.d.ts.map +1 -1
- package/dist/src/transport/index.js.map +1 -1
- package/dist/typedoc-urls.json +3 -0
- package/package.json +1 -1
- package/src/peer-id/index.ts +4 -0
- package/src/transport/index.ts +16 -7
|
@@ -14,6 +14,9 @@ export interface Secp256k1PeerId extends PeerId {
|
|
|
14
14
|
readonly type: 'secp256k1';
|
|
15
15
|
readonly publicKey: Uint8Array;
|
|
16
16
|
}
|
|
17
|
+
export interface URLPeerId extends PeerId {
|
|
18
|
+
readonly type: 'url';
|
|
19
|
+
}
|
|
17
20
|
export interface PeerId {
|
|
18
21
|
type: PeerIdType;
|
|
19
22
|
multihash: MultihashDigest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAEpE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAA;AAEzC,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAA;CAChC;AAED,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;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AI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CACrB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,eAAe,CAAA;IAC1B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,SAAS,CAAC,EAAE,UAAU,CAAA;IAEtB,QAAQ,IAAI,MAAM,CAAA;IAClB,KAAK,IAAI,GAAG,CAAA;IACZ,OAAO,IAAI,UAAU,CAAA;IACrB,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAA;CACtD;AAED,eAAO,MAAM,YAAY,eAAgC,CAAA;AAEzD,wBAAgB,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAErD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;AAEzD,MAAM,UAAU,QAAQ,CAAE,KAAU;IAClC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAA;AACtD,CAAC"}
|
|
@@ -3,6 +3,7 @@ import type { TypedEventTarget } from '../event-target.js';
|
|
|
3
3
|
import type { AbortOptions } from '../index.js';
|
|
4
4
|
import type { StreamMuxerFactory } from '../stream-muxer/index.js';
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
6
|
+
import type { ProgressOptions, ProgressEvent } from 'progress-events';
|
|
6
7
|
export interface ListenerEvents {
|
|
7
8
|
'connection': CustomEvent<Connection>;
|
|
8
9
|
'listening': CustomEvent;
|
|
@@ -36,13 +37,13 @@ export interface CreateListenerOptions {
|
|
|
36
37
|
handler?: ConnectionHandler;
|
|
37
38
|
upgrader: Upgrader;
|
|
38
39
|
}
|
|
39
|
-
export interface DialOptions extends AbortOptions {
|
|
40
|
+
export interface DialOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> {
|
|
40
41
|
upgrader: Upgrader;
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
|
-
* A libp2p transport
|
|
44
|
+
* A libp2p transport offers dial and listen methods to establish connections.
|
|
44
45
|
*/
|
|
45
|
-
export interface Transport {
|
|
46
|
+
export interface Transport<DialEvents extends ProgressEvent = ProgressEvent> {
|
|
46
47
|
/**
|
|
47
48
|
* Used to identify the transport
|
|
48
49
|
*/
|
|
@@ -54,7 +55,7 @@ export interface Transport {
|
|
|
54
55
|
/**
|
|
55
56
|
* Dial a given multiaddr.
|
|
56
57
|
*/
|
|
57
|
-
dial(ma: Multiaddr, options: DialOptions): Promise<Connection>;
|
|
58
|
+
dial(ma: Multiaddr, options: DialOptions<DialEvents>): Promise<Connection>;
|
|
58
59
|
/**
|
|
59
60
|
* Create transport listeners.
|
|
60
61
|
*/
|
|
@@ -84,7 +85,7 @@ export declare enum FaultTolerance {
|
|
|
84
85
|
*/
|
|
85
86
|
NO_FATAL = 1
|
|
86
87
|
}
|
|
87
|
-
export interface UpgraderOptions {
|
|
88
|
+
export interface UpgraderOptions<ConnectionUpgradeEvents extends ProgressEvent = ProgressEvent> extends ProgressOptions<ConnectionUpgradeEvents> {
|
|
88
89
|
skipEncryption?: boolean;
|
|
89
90
|
skipProtection?: boolean;
|
|
90
91
|
muxerFactory?: StreamMuxerFactory;
|
|
@@ -94,14 +95,16 @@ export interface UpgraderOptions {
|
|
|
94
95
|
*/
|
|
95
96
|
transient?: boolean;
|
|
96
97
|
}
|
|
98
|
+
export type InboundConnectionUpgradeEvents = ProgressEvent<'upgrader:encrypt-inbound-connection'> | ProgressEvent<'upgrader:multiplex-inbound-connection'>;
|
|
99
|
+
export type OutboundConnectionUpgradeEvents = ProgressEvent<'upgrader:encrypt-outbound-connection'> | ProgressEvent<'upgrader:multiplex-outbound-connection'>;
|
|
97
100
|
export interface Upgrader {
|
|
98
101
|
/**
|
|
99
102
|
* Upgrades an outbound connection on `transport.dial`.
|
|
100
103
|
*/
|
|
101
|
-
upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise<Connection>;
|
|
104
|
+
upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<OutboundConnectionUpgradeEvents>): Promise<Connection>;
|
|
102
105
|
/**
|
|
103
106
|
* Upgrades an inbound connection on transport listener.
|
|
104
107
|
*/
|
|
105
|
-
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise<Connection>;
|
|
108
|
+
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<Connection>;
|
|
106
109
|
}
|
|
107
110
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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B,EAAE,IAAI,CAAC,EAAE,eAAe,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE1H;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE,eAAe,CAAC,8BAA8B,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;CACzH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AA+BA,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAoD9D,MAAM,UAAU,WAAW,CAAE,KAAU;IACrC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAA;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB;;OAEG;IACH,6DAAa,CAAA;IAEb;;OAEG;IACH,2DAAQ,CAAA;AACV,CAAC,EAVW,cAAc,KAAd,cAAc,QAUzB"}
|
package/dist/typedoc-urls.json
CHANGED
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"TopologyFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.TopologyFilter.html",
|
|
114
114
|
"Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Transport.html",
|
|
115
115
|
"TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.TypedEventTarget.html",
|
|
116
|
+
"URLPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.URLPeerId.html",
|
|
116
117
|
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.UnsignedMessage.html",
|
|
117
118
|
"Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.Upgrader.html",
|
|
118
119
|
"UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.UpgraderOptions.html",
|
|
@@ -120,10 +121,12 @@
|
|
|
120
121
|
"ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.ConnectionStatus.html",
|
|
121
122
|
"Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Direction.html",
|
|
122
123
|
"EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.EventHandler.html",
|
|
124
|
+
"InboundConnectionUpgradeEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.InboundConnectionUpgradeEvents.html",
|
|
123
125
|
"KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.KeyType.html",
|
|
124
126
|
"Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Libp2pStatus.html",
|
|
125
127
|
".:Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Libp2pStatus.html",
|
|
126
128
|
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.Message.html",
|
|
129
|
+
"OutboundConnectionUpgradeEvents": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.OutboundConnectionUpgradeEvents.html",
|
|
127
130
|
"PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PeerIdType.html",
|
|
128
131
|
"PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PendingDialStatus.html",
|
|
129
132
|
".:PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.PendingDialStatus.html",
|
package/package.json
CHANGED
package/src/peer-id/index.ts
CHANGED
package/src/transport/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { TypedEventTarget } from '../event-target.js'
|
|
|
3
3
|
import type { AbortOptions } from '../index.js'
|
|
4
4
|
import type { StreamMuxerFactory } from '../stream-muxer/index.js'
|
|
5
5
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
6
|
+
import type { ProgressOptions, ProgressEvent } from 'progress-events'
|
|
6
7
|
|
|
7
8
|
export interface ListenerEvents {
|
|
8
9
|
'connection': CustomEvent<Connection>
|
|
@@ -39,14 +40,14 @@ export interface CreateListenerOptions {
|
|
|
39
40
|
upgrader: Upgrader
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
export interface DialOptions extends AbortOptions {
|
|
43
|
+
export interface DialOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> {
|
|
43
44
|
upgrader: Upgrader
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
* A libp2p transport
|
|
48
|
+
* A libp2p transport offers dial and listen methods to establish connections.
|
|
48
49
|
*/
|
|
49
|
-
export interface Transport {
|
|
50
|
+
export interface Transport<DialEvents extends ProgressEvent = ProgressEvent> {
|
|
50
51
|
/**
|
|
51
52
|
* Used to identify the transport
|
|
52
53
|
*/
|
|
@@ -60,7 +61,7 @@ export interface Transport {
|
|
|
60
61
|
/**
|
|
61
62
|
* Dial a given multiaddr.
|
|
62
63
|
*/
|
|
63
|
-
dial(ma: Multiaddr, options: DialOptions): Promise<Connection>
|
|
64
|
+
dial(ma: Multiaddr, options: DialOptions<DialEvents>): Promise<Connection>
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
67
|
* Create transport listeners.
|
|
@@ -99,7 +100,7 @@ export enum FaultTolerance {
|
|
|
99
100
|
NO_FATAL
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
export interface UpgraderOptions {
|
|
103
|
+
export interface UpgraderOptions<ConnectionUpgradeEvents extends ProgressEvent = ProgressEvent> extends ProgressOptions<ConnectionUpgradeEvents> {
|
|
103
104
|
skipEncryption?: boolean
|
|
104
105
|
skipProtection?: boolean
|
|
105
106
|
muxerFactory?: StreamMuxerFactory
|
|
@@ -111,14 +112,22 @@ export interface UpgraderOptions {
|
|
|
111
112
|
transient?: boolean
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
export type InboundConnectionUpgradeEvents =
|
|
116
|
+
ProgressEvent<'upgrader:encrypt-inbound-connection'> |
|
|
117
|
+
ProgressEvent<'upgrader:multiplex-inbound-connection'>
|
|
118
|
+
|
|
119
|
+
export type OutboundConnectionUpgradeEvents =
|
|
120
|
+
ProgressEvent<'upgrader:encrypt-outbound-connection'> |
|
|
121
|
+
ProgressEvent<'upgrader:multiplex-outbound-connection'>
|
|
122
|
+
|
|
114
123
|
export interface Upgrader {
|
|
115
124
|
/**
|
|
116
125
|
* Upgrades an outbound connection on `transport.dial`.
|
|
117
126
|
*/
|
|
118
|
-
upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise<Connection>
|
|
127
|
+
upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<OutboundConnectionUpgradeEvents>): Promise<Connection>
|
|
119
128
|
|
|
120
129
|
/**
|
|
121
130
|
* Upgrades an inbound connection on transport listener.
|
|
122
131
|
*/
|
|
123
|
-
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions): Promise<Connection>
|
|
132
|
+
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<Connection>
|
|
124
133
|
}
|