@libp2p/interface 0.1.5 → 0.1.6-05b52d69c
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/errors.d.ts +4 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +5 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +35 -14
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/peer-info/index.d.ts +12 -1
- package/dist/src/peer-info/index.d.ts.map +1 -1
- package/dist/src/startable.d.ts +0 -1
- package/dist/src/startable.d.ts.map +1 -1
- package/dist/src/startable.js.map +1 -1
- package/dist/src/topology/index.d.ts +0 -2
- package/dist/src/topology/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/errors.ts +7 -0
- package/src/index.ts +41 -15
- package/src/peer-info/index.ts +13 -1
- package/src/startable.ts +0 -2
- package/src/topology/index.ts +0 -3
- package/dist/src/keychain/index.d.ts +0 -154
- package/dist/src/keychain/index.d.ts.map +0 -1
- package/dist/src/keychain/index.js +0 -23
- package/dist/src/keychain/index.js.map +0 -1
- package/dist/typedoc-urls.json +0 -262
- package/src/keychain/index.ts +0 -167
package/dist/src/errors.d.ts
CHANGED
|
@@ -30,4 +30,8 @@ export declare class InvalidCryptoTransmissionError extends Error {
|
|
|
30
30
|
constructor(message?: string);
|
|
31
31
|
static readonly code = "ERR_INVALID_CRYPTO_TRANSMISSION";
|
|
32
32
|
}
|
|
33
|
+
export declare const ERR_TIMEOUT = "ERR_TIMEOUT";
|
|
34
|
+
export declare const ERR_INVALID_PARAMETERS = "ERR_INVALID_PARAMETERS";
|
|
35
|
+
export declare const ERR_NOT_FOUND = "ERR_NOT_FOUND";
|
|
36
|
+
export declare const ERR_INVALID_MESSAGE = "ERR_INVALID_MESSAGE";
|
|
33
37
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/src/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAA;gBAEf,OAAO,GAAE,MAAoC;IAM1D,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAc;IAElC,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAY;CACjC;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,KAAK;aAKvE,IAAI,EAAE,MAAM;IAJ9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAoB;IAKxC,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAwB;CAC7C;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAA4B;IAKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAA;gBAEf,OAAO,GAAE,MAAoC;IAM1D,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAc;IAElC,MAAM,CAAC,QAAQ,CAAC,IAAI,aAAY;CACjC;AAED,qBAAa,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAE,SAAQ,KAAK;aAKvE,IAAI,EAAE,MAAM;IAJ9B,SAAgB,KAAK,EAAE,CAAC,CAAA;gBAGtB,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EAC5B,KAAK,CAAC,EAAE,CAAC;CAOZ;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IACrC,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAoB;IAKxC,MAAM,CAAC,QAAQ,CAAC,IAAI,yBAAwB;CAC7C;AAED,qBAAa,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAA4B;IAKhD,MAAM,CAAC,QAAQ,CAAC,IAAI,iCAAgC;CACrD;AAED,qBAAa,8BAA+B,SAAQ,KAAK;IAChD,IAAI,EAAE,MAAM,CAAA;gBAEN,OAAO,SAAgC;IAKpD,MAAM,CAAC,QAAQ,CAAC,IAAI,qCAAoC;CACzD;AAID,eAAO,MAAM,WAAW,gBAAgB,CAAA;AACxC,eAAO,MAAM,sBAAsB,2BAA2B,CAAA;AAC9D,eAAO,MAAM,aAAa,kBAAkB,CAAA;AAC5C,eAAO,MAAM,mBAAmB,wBAAwB,CAAA"}
|
package/dist/src/errors.js
CHANGED
|
@@ -48,4 +48,9 @@ export class InvalidCryptoTransmissionError extends Error {
|
|
|
48
48
|
}
|
|
49
49
|
static code = 'ERR_INVALID_CRYPTO_TRANSMISSION';
|
|
50
50
|
}
|
|
51
|
+
// Error codes
|
|
52
|
+
export const ERR_TIMEOUT = 'ERR_TIMEOUT';
|
|
53
|
+
export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS';
|
|
54
|
+
export const ERR_NOT_FOUND = 'ERR_NOT_FOUND';
|
|
55
|
+
export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE';
|
|
51
56
|
//# sourceMappingURL=errors.js.map
|
package/dist/src/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnB,IAAI,CAAQ;IACZ,IAAI,CAAQ;IAE5B,YAAa,UAAkB,2BAA2B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IAC7B,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,WAAW,CAAA;IAElC,MAAM,CAAU,IAAI,GAAG,SAAS,CAAA;;AAGlC,MAAM,OAAO,SAAiE,SAAQ,KAAK;IAKvE;IAJF,KAAK,CAAG;IAExB,YACE,OAAe,EACC,IAAY,EAC5B,KAAS;QAET,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,SAAI,GAAJ,IAAI,CAAQ;QAK5B,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,IAAI,WAAW,CAAA;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAO,CAAA,CAAC,oEAAoE;IACpG,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,qBAAqB,CAAA;;AAG9C,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC5C,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KAAK;IACrC,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,iBAAiB;QACtC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAA;IACtC,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,qBAAqB,CAAA;;AAG9C,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC5C,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,yBAAyB;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC,IAAI,CAAA;IAC7C,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,6BAA6B,CAAA;;AAGtD,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAChD,IAAI,CAAQ;IAEnB,YAAa,OAAO,GAAG,6BAA6B;QAClD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC,IAAI,CAAA;IACjD,CAAC;IAED,MAAM,CAAU,IAAI,GAAG,iCAAiC,CAAA;;AAG1D,cAAc;AAEd,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAA;AAC5C,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import type { Connection, NewStreamOptions, Stream } from './connection/index.js';
|
|
17
17
|
import type { ContentRouting } from './content-routing/index.js';
|
|
18
18
|
import type { TypedEventTarget } from './events.js';
|
|
19
|
-
import type { KeyChain } from './keychain/index.js';
|
|
20
19
|
import type { Metrics } from './metrics/index.js';
|
|
21
20
|
import type { PeerId } from './peer-id/index.js';
|
|
22
21
|
import type { PeerInfo } from './peer-info/index.js';
|
|
@@ -92,6 +91,21 @@ export interface IdentifyResult {
|
|
|
92
91
|
*/
|
|
93
92
|
connection: Connection;
|
|
94
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Logger component for libp2p
|
|
96
|
+
*/
|
|
97
|
+
export interface Logger {
|
|
98
|
+
(formatter: any, ...args: any[]): void;
|
|
99
|
+
error(formatter: any, ...args: any[]): void;
|
|
100
|
+
trace(formatter: any, ...args: any[]): void;
|
|
101
|
+
enabled: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Peer logger component for libp2p
|
|
105
|
+
*/
|
|
106
|
+
export interface ComponentLogger {
|
|
107
|
+
forComponent(name: string): Logger;
|
|
108
|
+
}
|
|
95
109
|
/**
|
|
96
110
|
* Once you have a libp2p instance, you can listen to several events it emits,
|
|
97
111
|
* so that you can be notified of relevant network events.
|
|
@@ -340,19 +354,6 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
340
354
|
* ```
|
|
341
355
|
*/
|
|
342
356
|
contentRouting: ContentRouting;
|
|
343
|
-
/**
|
|
344
|
-
* The keychain contains the keys used by the current node, and can create new
|
|
345
|
-
* keys, export them, import them, etc.
|
|
346
|
-
*
|
|
347
|
-
* @example
|
|
348
|
-
*
|
|
349
|
-
* ```js
|
|
350
|
-
* const keyInfo = await libp2p.keychain.createKey('new key')
|
|
351
|
-
* console.info(keyInfo)
|
|
352
|
-
* // { id: '...', name: 'new key' }
|
|
353
|
-
* ```
|
|
354
|
-
*/
|
|
355
|
-
keychain: KeyChain;
|
|
356
357
|
/**
|
|
357
358
|
* The metrics subsystem allows recording values to assess the health/performance
|
|
358
359
|
* of the running node.
|
|
@@ -369,6 +370,7 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
369
370
|
* ```
|
|
370
371
|
*/
|
|
371
372
|
metrics?: Metrics;
|
|
373
|
+
logger: ComponentLogger;
|
|
372
374
|
/**
|
|
373
375
|
* Get a deduplicated list of peer advertising multiaddrs by concatenating
|
|
374
376
|
* the listen addresses used by transports with any configured
|
|
@@ -552,6 +554,19 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
552
554
|
*/
|
|
553
555
|
services: T;
|
|
554
556
|
}
|
|
557
|
+
/**
|
|
558
|
+
* Metadata about the current node
|
|
559
|
+
*/
|
|
560
|
+
export interface NodeInfo {
|
|
561
|
+
/**
|
|
562
|
+
* The implementation name
|
|
563
|
+
*/
|
|
564
|
+
name: string;
|
|
565
|
+
/**
|
|
566
|
+
* The implementation version
|
|
567
|
+
*/
|
|
568
|
+
version: string;
|
|
569
|
+
}
|
|
555
570
|
/**
|
|
556
571
|
* An object that contains an AbortSignal as
|
|
557
572
|
* the optional `signal` property.
|
|
@@ -572,6 +587,12 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
572
587
|
export interface AbortOptions {
|
|
573
588
|
signal?: AbortSignal;
|
|
574
589
|
}
|
|
590
|
+
/**
|
|
591
|
+
* An object that contains a Logger as the `log` property.
|
|
592
|
+
*/
|
|
593
|
+
export interface LoggerOptions {
|
|
594
|
+
log: Logger;
|
|
595
|
+
}
|
|
575
596
|
/**
|
|
576
597
|
* Returns a new type with all fields marked optional.
|
|
577
598
|
*
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.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AAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjJ,CAAA"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import type { PeerId } from '../peer-id/index.js';
|
|
2
2
|
import type { Multiaddr } from '@multiformats/multiaddr';
|
|
3
|
+
/**
|
|
4
|
+
* A `PeerInfo` is a lightweight object that represents a remote peer, it can be
|
|
5
|
+
* obtained from peer discovery mechanisms, HTTP RPC endpoints, etc.
|
|
6
|
+
*
|
|
7
|
+
* @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info
|
|
8
|
+
*/
|
|
3
9
|
export interface PeerInfo {
|
|
10
|
+
/**
|
|
11
|
+
* The identifier of the remote peer
|
|
12
|
+
*/
|
|
4
13
|
id: PeerId;
|
|
14
|
+
/**
|
|
15
|
+
* The multiaddrs a peer is listening on
|
|
16
|
+
*/
|
|
5
17
|
multiaddrs: Multiaddr[];
|
|
6
|
-
protocols: string[];
|
|
7
18
|
}
|
|
8
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-info/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-info/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB"}
|
package/dist/src/startable.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startable.d.ts","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB
|
|
1
|
+
{"version":3,"file":"startable.d.ts","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,WAAW,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC;;;;OAIG;IACH,IAAI,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;;OAIG;IACH,SAAS,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnC;AAED,wBAAgB,WAAW,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,SAAS,CAEvD;AAED,wBAAsB,KAAK,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B1D;AAED,wBAAsB,IAAI,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startable.js","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"startable.js","sourceRoot":"","sources":["../../src/startable.ts"],"names":[],"mappings":"AA+CA,MA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OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,UAAU,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,CAAC,UAAU,EAAE,CAAA;SACrB;IACH,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC,CAAC,CACH,CAAA;IAED,MAAM,OAAO,CAAC,GAAG,CACf,UAAU,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;QACvB,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,EAAE;YACvB,MAAM,CAAC,CAAC,SAAS,EAAE,CAAA;SACpB;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Connection } from '../connection/index.js';
|
|
2
2
|
import type { PeerId } from '../peer-id/index.js';
|
|
3
3
|
export interface Topology {
|
|
4
|
-
min?: number;
|
|
5
|
-
max?: number;
|
|
6
4
|
/**
|
|
7
5
|
* If true, invoke `onConnect` for this topology on transient (e.g. short-lived
|
|
8
6
|
* and/or data-limited) connections. (default: false)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,MAAM,WAAW,QAAQ;IACvB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/topology/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAEjD,MAAM,WAAW,QAAQ;IACvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B;;;OAGG;IACH,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IAElD;;;OAGG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-05b52d69c",
|
|
4
4
|
"description": "The interface implemented by a libp2p node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/interface#readme",
|
|
@@ -39,9 +39,6 @@
|
|
|
39
39
|
"!dist/test",
|
|
40
40
|
"!**/*.tsbuildinfo"
|
|
41
41
|
],
|
|
42
|
-
"browser": {
|
|
43
|
-
"events": "./dist/src/events.browser.js"
|
|
44
|
-
},
|
|
45
42
|
"exports": {
|
|
46
43
|
".": {
|
|
47
44
|
"types": "./dist/src/index.d.ts",
|
|
@@ -161,22 +158,25 @@
|
|
|
161
158
|
"test:electron-main": "aegir test -t electron-main"
|
|
162
159
|
},
|
|
163
160
|
"dependencies": {
|
|
164
|
-
"@multiformats/multiaddr": "^12.1.
|
|
161
|
+
"@multiformats/multiaddr": "^12.1.10",
|
|
165
162
|
"abortable-iterator": "^5.0.1",
|
|
166
|
-
"it-pushable": "^3.2.
|
|
163
|
+
"it-pushable": "^3.2.1",
|
|
167
164
|
"it-stream-types": "^2.0.1",
|
|
168
|
-
"multiformats": "^12.
|
|
165
|
+
"multiformats": "^12.1.3",
|
|
169
166
|
"p-defer": "^4.0.0",
|
|
170
167
|
"race-signal": "^1.0.0",
|
|
171
168
|
"uint8arraylist": "^2.4.3"
|
|
172
169
|
},
|
|
173
170
|
"devDependencies": {
|
|
174
|
-
"@types/sinon": "^
|
|
171
|
+
"@types/sinon": "^17.0.0",
|
|
175
172
|
"aegir": "^41.0.2",
|
|
176
173
|
"delay": "^6.0.0",
|
|
177
174
|
"it-all": "^3.0.3",
|
|
178
175
|
"it-drain": "^3.0.3",
|
|
179
176
|
"sinon": "^17.0.0",
|
|
180
177
|
"sinon-ts": "^2.0.0"
|
|
178
|
+
},
|
|
179
|
+
"browser": {
|
|
180
|
+
"events": "./dist/src/events.browser.js"
|
|
181
181
|
}
|
|
182
182
|
}
|
package/src/errors.ts
CHANGED
|
@@ -65,3 +65,10 @@ export class InvalidCryptoTransmissionError extends Error {
|
|
|
65
65
|
|
|
66
66
|
static readonly code = 'ERR_INVALID_CRYPTO_TRANSMISSION'
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
// Error codes
|
|
70
|
+
|
|
71
|
+
export const ERR_TIMEOUT = 'ERR_TIMEOUT'
|
|
72
|
+
export const ERR_INVALID_PARAMETERS = 'ERR_INVALID_PARAMETERS'
|
|
73
|
+
export const ERR_NOT_FOUND = 'ERR_NOT_FOUND'
|
|
74
|
+
export const ERR_INVALID_MESSAGE = 'ERR_INVALID_MESSAGE'
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
import type { Connection, NewStreamOptions, Stream } from './connection/index.js'
|
|
18
18
|
import type { ContentRouting } from './content-routing/index.js'
|
|
19
19
|
import type { TypedEventTarget } from './events.js'
|
|
20
|
-
import type { KeyChain } from './keychain/index.js'
|
|
21
20
|
import type { Metrics } from './metrics/index.js'
|
|
22
21
|
import type { PeerId } from './peer-id/index.js'
|
|
23
22
|
import type { PeerInfo } from './peer-info/index.js'
|
|
@@ -106,6 +105,23 @@ export interface IdentifyResult {
|
|
|
106
105
|
connection: Connection
|
|
107
106
|
}
|
|
108
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Logger component for libp2p
|
|
110
|
+
*/
|
|
111
|
+
export interface Logger {
|
|
112
|
+
(formatter: any, ...args: any[]): void
|
|
113
|
+
error(formatter: any, ...args: any[]): void
|
|
114
|
+
trace(formatter: any, ...args: any[]): void
|
|
115
|
+
enabled: boolean
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Peer logger component for libp2p
|
|
120
|
+
*/
|
|
121
|
+
export interface ComponentLogger {
|
|
122
|
+
forComponent(name: string): Logger
|
|
123
|
+
}
|
|
124
|
+
|
|
109
125
|
/**
|
|
110
126
|
* Once you have a libp2p instance, you can listen to several events it emits,
|
|
111
127
|
* so that you can be notified of relevant network events.
|
|
@@ -377,20 +393,6 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
377
393
|
*/
|
|
378
394
|
contentRouting: ContentRouting
|
|
379
395
|
|
|
380
|
-
/**
|
|
381
|
-
* The keychain contains the keys used by the current node, and can create new
|
|
382
|
-
* keys, export them, import them, etc.
|
|
383
|
-
*
|
|
384
|
-
* @example
|
|
385
|
-
*
|
|
386
|
-
* ```js
|
|
387
|
-
* const keyInfo = await libp2p.keychain.createKey('new key')
|
|
388
|
-
* console.info(keyInfo)
|
|
389
|
-
* // { id: '...', name: 'new key' }
|
|
390
|
-
* ```
|
|
391
|
-
*/
|
|
392
|
-
keychain: KeyChain
|
|
393
|
-
|
|
394
396
|
/**
|
|
395
397
|
* The metrics subsystem allows recording values to assess the health/performance
|
|
396
398
|
* of the running node.
|
|
@@ -408,6 +410,8 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
408
410
|
*/
|
|
409
411
|
metrics?: Metrics
|
|
410
412
|
|
|
413
|
+
logger: ComponentLogger
|
|
414
|
+
|
|
411
415
|
/**
|
|
412
416
|
* Get a deduplicated list of peer advertising multiaddrs by concatenating
|
|
413
417
|
* the listen addresses used by transports with any configured
|
|
@@ -605,6 +609,21 @@ export interface Libp2p<T extends ServiceMap = ServiceMap> extends Startable, Ty
|
|
|
605
609
|
services: T
|
|
606
610
|
}
|
|
607
611
|
|
|
612
|
+
/**
|
|
613
|
+
* Metadata about the current node
|
|
614
|
+
*/
|
|
615
|
+
export interface NodeInfo {
|
|
616
|
+
/**
|
|
617
|
+
* The implementation name
|
|
618
|
+
*/
|
|
619
|
+
name: string
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* The implementation version
|
|
623
|
+
*/
|
|
624
|
+
version: string
|
|
625
|
+
}
|
|
626
|
+
|
|
608
627
|
/**
|
|
609
628
|
* An object that contains an AbortSignal as
|
|
610
629
|
* the optional `signal` property.
|
|
@@ -626,6 +645,13 @@ export interface AbortOptions {
|
|
|
626
645
|
signal?: AbortSignal
|
|
627
646
|
}
|
|
628
647
|
|
|
648
|
+
/**
|
|
649
|
+
* An object that contains a Logger as the `log` property.
|
|
650
|
+
*/
|
|
651
|
+
export interface LoggerOptions {
|
|
652
|
+
log: Logger
|
|
653
|
+
}
|
|
654
|
+
|
|
629
655
|
/**
|
|
630
656
|
* Returns a new type with all fields marked optional.
|
|
631
657
|
*
|
package/src/peer-info/index.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import type { PeerId } from '../peer-id/index.js'
|
|
2
2
|
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A `PeerInfo` is a lightweight object that represents a remote peer, it can be
|
|
6
|
+
* obtained from peer discovery mechanisms, HTTP RPC endpoints, etc.
|
|
7
|
+
*
|
|
8
|
+
* @see https://docs.libp2p.io/concepts/fundamentals/peers/#peer-info
|
|
9
|
+
*/
|
|
4
10
|
export interface PeerInfo {
|
|
11
|
+
/**
|
|
12
|
+
* The identifier of the remote peer
|
|
13
|
+
*/
|
|
5
14
|
id: PeerId
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The multiaddrs a peer is listening on
|
|
18
|
+
*/
|
|
6
19
|
multiaddrs: Multiaddr[]
|
|
7
|
-
protocols: string[]
|
|
8
20
|
}
|
package/src/startable.ts
CHANGED
package/src/topology/index.ts
CHANGED
|
@@ -2,9 +2,6 @@ import type { Connection } from '../connection/index.js'
|
|
|
2
2
|
import type { PeerId } from '../peer-id/index.js'
|
|
3
3
|
|
|
4
4
|
export interface Topology {
|
|
5
|
-
min?: number
|
|
6
|
-
max?: number
|
|
7
|
-
|
|
8
5
|
/**
|
|
9
6
|
* If true, invoke `onConnect` for this topology on transient (e.g. short-lived
|
|
10
7
|
* and/or data-limited) connections. (default: false)
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* The libp2p keychain provides an API to store keys in a datastore in
|
|
5
|
-
* an encrypted format.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { createLibp2p } from 'libp2p'
|
|
11
|
-
* import { FsDatastore } from 'datastore-fs'
|
|
12
|
-
*
|
|
13
|
-
* const node = await createLibp2p({
|
|
14
|
-
* datastore: new FsDatastore('/path/to/dir')
|
|
15
|
-
* })
|
|
16
|
-
*
|
|
17
|
-
* const info = await node.keychain.createKey('my-new-key', 'Ed25519')
|
|
18
|
-
*
|
|
19
|
-
* console.info(info) // { id: '...', name: 'my-new-key' }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
import type { KeyType } from '../keys/index.js';
|
|
23
|
-
import type { PeerId } from '../peer-id/index.js';
|
|
24
|
-
import type { Multibase } from 'multiformats/bases/interface';
|
|
25
|
-
export interface KeyInfo {
|
|
26
|
-
/**
|
|
27
|
-
* The universally unique key id
|
|
28
|
-
*/
|
|
29
|
-
id: string;
|
|
30
|
-
/**
|
|
31
|
-
* The local key name
|
|
32
|
-
*/
|
|
33
|
-
name: string;
|
|
34
|
-
}
|
|
35
|
-
export interface KeyChain {
|
|
36
|
-
/**
|
|
37
|
-
* Export an existing key as a PEM encrypted PKCS #8 string.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
*
|
|
41
|
-
* ```js
|
|
42
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
43
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
exportKey(name: string, password: string): Promise<Multibase<'m'>>;
|
|
47
|
-
/**
|
|
48
|
-
* Import a new key from a PEM encoded PKCS #8 string.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
*
|
|
52
|
-
* ```js
|
|
53
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
54
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
55
|
-
* const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
importKey(name: string, pem: string, password: string): Promise<KeyInfo>;
|
|
59
|
-
/**
|
|
60
|
-
* Import a new key from a PeerId with a private key component
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
*
|
|
64
|
-
* ```js
|
|
65
|
-
* const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
importPeer(name: string, peerId: PeerId): Promise<KeyInfo>;
|
|
69
|
-
/**
|
|
70
|
-
* Export an existing key as a PeerId
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
*
|
|
74
|
-
* ```js
|
|
75
|
-
* const peerId = await libp2p.keychain.exportPeerId('key-name')
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
exportPeerId(name: string): Promise<PeerId>;
|
|
79
|
-
/**
|
|
80
|
-
* Create a key in the keychain.
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
*
|
|
84
|
-
* ```js
|
|
85
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
createKey(name: string, type: KeyType, size?: number): Promise<KeyInfo>;
|
|
89
|
-
/**
|
|
90
|
-
* List all the keys.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
*
|
|
94
|
-
* ```js
|
|
95
|
-
* const keyInfos = await libp2p.keychain.listKeys()
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
listKeys(): Promise<KeyInfo[]>;
|
|
99
|
-
/**
|
|
100
|
-
* Removes a key from the keychain.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
*
|
|
104
|
-
* ```js
|
|
105
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
106
|
-
* const keyInfo = await libp2p.keychain.removeKey('keyTest')
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
removeKey(name: string): Promise<KeyInfo>;
|
|
110
|
-
/**
|
|
111
|
-
* Rename a key in the keychain.
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
*
|
|
115
|
-
* ```js
|
|
116
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
117
|
-
* const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
renameKey(oldName: string, newName: string): Promise<KeyInfo>;
|
|
121
|
-
/**
|
|
122
|
-
* Find a key by it's id.
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
*
|
|
126
|
-
* ```js
|
|
127
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
128
|
-
* const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id)
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
findKeyById(id: string): Promise<KeyInfo>;
|
|
132
|
-
/**
|
|
133
|
-
* Find a key by it's name.
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
*
|
|
137
|
-
* ```js
|
|
138
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
139
|
-
* const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest')
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
findKeyByName(name: string): Promise<KeyInfo>;
|
|
143
|
-
/**
|
|
144
|
-
* Rotate keychain password and re-encrypt all associated keys
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
*
|
|
148
|
-
* ```js
|
|
149
|
-
* await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
rotateKeychainPass(oldPass: string, newPass: string): Promise<void>;
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/keychain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAE7D,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,QAAQ;IACvB;;;;;;;;;OASG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;IAElE;;;;;;;;;;OAUG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAExE;;;;;;;;OAQG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE1D;;;;;;;;OAQG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAE3C;;;;;;;;OAQG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvE;;;;;;;;OAQG;IACH,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAE9B;;;;;;;;;OASG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEzC;;;;;;;;;OASG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE7D;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEzC;;;;;;;;;OASG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE7C;;;;;;;;OAQG;IACH,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpE"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* The libp2p keychain provides an API to store keys in a datastore in
|
|
5
|
-
* an encrypted format.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { createLibp2p } from 'libp2p'
|
|
11
|
-
* import { FsDatastore } from 'datastore-fs'
|
|
12
|
-
*
|
|
13
|
-
* const node = await createLibp2p({
|
|
14
|
-
* datastore: new FsDatastore('/path/to/dir')
|
|
15
|
-
* })
|
|
16
|
-
*
|
|
17
|
-
* const info = await node.keychain.createKey('my-new-key', 'Ed25519')
|
|
18
|
-
*
|
|
19
|
-
* console.info(info) // { id: '...', name: 'my-new-key' }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/keychain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Connection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Connection.html",
|
|
3
|
-
"./connection:Connection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Connection.html",
|
|
4
|
-
"ConnectionProtector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionProtector.html",
|
|
5
|
-
"./connection:ConnectionProtector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionProtector.html",
|
|
6
|
-
"ConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionTimeline.html",
|
|
7
|
-
"./connection:ConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionTimeline.html",
|
|
8
|
-
"MultiaddrConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnection.html",
|
|
9
|
-
"./connection:MultiaddrConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnection.html",
|
|
10
|
-
"MultiaddrConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnectionTimeline.html",
|
|
11
|
-
"./connection:MultiaddrConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnectionTimeline.html",
|
|
12
|
-
"NewStreamOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.NewStreamOptions.html",
|
|
13
|
-
"./connection:NewStreamOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.NewStreamOptions.html",
|
|
14
|
-
"Stream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Stream.html",
|
|
15
|
-
"./connection:Stream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Stream.html",
|
|
16
|
-
"StreamTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.StreamTimeline.html",
|
|
17
|
-
"./connection:StreamTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.StreamTimeline.html",
|
|
18
|
-
"ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ConnectionStatus.html",
|
|
19
|
-
"./connection:ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ConnectionStatus.html",
|
|
20
|
-
"Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.Direction.html",
|
|
21
|
-
"./connection:Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.Direction.html",
|
|
22
|
-
"ReadStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ReadStatus.html",
|
|
23
|
-
"./connection:ReadStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ReadStatus.html",
|
|
24
|
-
"StreamStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.StreamStatus.html",
|
|
25
|
-
"./connection:StreamStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.StreamStatus.html",
|
|
26
|
-
"WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.WriteStatus.html",
|
|
27
|
-
"./connection:WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.WriteStatus.html",
|
|
28
|
-
"symbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.connection.symbol.html",
|
|
29
|
-
"./connection:symbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.connection.symbol.html",
|
|
30
|
-
"isConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.connection.isConnection.html",
|
|
31
|
-
"./connection:isConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.connection.isConnection.html",
|
|
32
|
-
"ConnectionEncrypter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.ConnectionEncrypter.html",
|
|
33
|
-
"./connection-encrypter:ConnectionEncrypter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.ConnectionEncrypter.html",
|
|
34
|
-
"SecuredConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.SecuredConnection.html",
|
|
35
|
-
"./connection-encrypter:SecuredConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.SecuredConnection.html",
|
|
36
|
-
"ConnectionGater": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_gater.ConnectionGater.html",
|
|
37
|
-
"./connection-gater:ConnectionGater": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_gater.ConnectionGater.html",
|
|
38
|
-
"ContentRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.content_routing.ContentRouting.html",
|
|
39
|
-
"./content-routing:ContentRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.content_routing.ContentRouting.html",
|
|
40
|
-
"contentRouting": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.content_routing.contentRouting-1.html",
|
|
41
|
-
"./content-routing:contentRouting": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.content_routing.contentRouting-1.html",
|
|
42
|
-
"AbortError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.AbortError.html",
|
|
43
|
-
"./errors:AbortError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.AbortError.html",
|
|
44
|
-
"CodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.CodeError.html",
|
|
45
|
-
"./errors:CodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.CodeError.html",
|
|
46
|
-
"InvalidCryptoExchangeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoExchangeError.html",
|
|
47
|
-
"./errors:InvalidCryptoExchangeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoExchangeError.html",
|
|
48
|
-
"InvalidCryptoTransmissionError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoTransmissionError.html",
|
|
49
|
-
"./errors:InvalidCryptoTransmissionError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoTransmissionError.html",
|
|
50
|
-
"UnexpectedPeerError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.UnexpectedPeerError.html",
|
|
51
|
-
"./errors:UnexpectedPeerError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.UnexpectedPeerError.html",
|
|
52
|
-
"TypedEventEmitter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.events.TypedEventEmitter.html",
|
|
53
|
-
"./events:TypedEventEmitter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.events.TypedEventEmitter.html",
|
|
54
|
-
"EventCallback": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.EventCallback.html",
|
|
55
|
-
"./events:EventCallback": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.EventCallback.html",
|
|
56
|
-
"EventObject": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.EventObject.html",
|
|
57
|
-
"./events:EventObject": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.EventObject.html",
|
|
58
|
-
"TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.TypedEventTarget.html",
|
|
59
|
-
"./events:TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.events.TypedEventTarget.html",
|
|
60
|
-
"EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.events.EventHandler.html",
|
|
61
|
-
"./events:EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.events.EventHandler.html",
|
|
62
|
-
"CustomEvent": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.events.CustomEvent.html",
|
|
63
|
-
"./events:CustomEvent": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.events.CustomEvent.html",
|
|
64
|
-
"setMaxListeners": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.events.setMaxListeners.html",
|
|
65
|
-
"./events:setMaxListeners": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.events.setMaxListeners.html",
|
|
66
|
-
"AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
|
|
67
|
-
".:AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
|
|
68
|
-
"AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
|
|
69
|
-
".:AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
|
|
70
|
-
"IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
|
|
71
|
-
".:IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
|
|
72
|
-
"Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2p.html",
|
|
73
|
-
".:Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2p.html",
|
|
74
|
-
"Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
|
|
75
|
-
".:Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
|
|
76
|
-
"PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
|
|
77
|
-
".:PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
|
|
78
|
-
"PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
|
|
79
|
-
".:PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
|
|
80
|
-
"SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
|
|
81
|
-
".:SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
|
|
82
|
-
"PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
|
|
83
|
-
".:PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
|
|
84
|
-
"RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
|
|
85
|
-
".:RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
|
|
86
|
-
"ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
|
|
87
|
-
".:ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
|
|
88
|
-
"KeyChain": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keychain.KeyChain.html",
|
|
89
|
-
"./keychain:KeyChain": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keychain.KeyChain.html",
|
|
90
|
-
"KeyInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keychain.KeyInfo.html",
|
|
91
|
-
"./keychain:KeyInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keychain.KeyInfo.html",
|
|
92
|
-
"PrivateKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PrivateKey.html",
|
|
93
|
-
"./keys:PrivateKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PrivateKey.html",
|
|
94
|
-
"PublicKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PublicKey.html",
|
|
95
|
-
"./keys:PublicKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PublicKey.html",
|
|
96
|
-
"KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.keys.KeyType.html",
|
|
97
|
-
"./keys:KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.keys.KeyType.html",
|
|
98
|
-
"Ed25519": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.Ed25519.html",
|
|
99
|
-
"./keys:Ed25519": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.Ed25519.html",
|
|
100
|
-
"RSA": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.RSA.html",
|
|
101
|
-
"./keys:RSA": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.RSA.html",
|
|
102
|
-
"secp256k1": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.secp256k1.html",
|
|
103
|
-
"./keys:secp256k1": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.secp256k1.html",
|
|
104
|
-
"CalculatedMetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CalculatedMetricOptions.html",
|
|
105
|
-
"./metrics:CalculatedMetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CalculatedMetricOptions.html",
|
|
106
|
-
"Counter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Counter.html",
|
|
107
|
-
"./metrics:Counter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Counter.html",
|
|
108
|
-
"CounterGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CounterGroup.html",
|
|
109
|
-
"./metrics:CounterGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CounterGroup.html",
|
|
110
|
-
"Metric": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metric.html",
|
|
111
|
-
"./metrics:Metric": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metric.html",
|
|
112
|
-
"MetricGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricGroup.html",
|
|
113
|
-
"./metrics:MetricGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricGroup.html",
|
|
114
|
-
"MetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricOptions.html",
|
|
115
|
-
"./metrics:MetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricOptions.html",
|
|
116
|
-
"Metrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metrics.html",
|
|
117
|
-
"./metrics:Metrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metrics.html",
|
|
118
|
-
"StopTimer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.StopTimer.html",
|
|
119
|
-
"./metrics:StopTimer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.StopTimer.html",
|
|
120
|
-
"CalculateMetric": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.metrics.CalculateMetric.html",
|
|
121
|
-
"./metrics:CalculateMetric": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.metrics.CalculateMetric.html",
|
|
122
|
-
"CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics_tracked_map.CreateTrackedMapInit.html",
|
|
123
|
-
"./metrics/tracked-map:CreateTrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics_tracked_map.CreateTrackedMapInit.html",
|
|
124
|
-
"TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics_tracked_map.TrackedMapInit.html",
|
|
125
|
-
"./metrics/tracked-map:TrackedMapInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics_tracked_map.TrackedMapInit.html",
|
|
126
|
-
"trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.metrics_tracked_map.trackedMap.html",
|
|
127
|
-
"./metrics/tracked-map:trackedMap": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.metrics_tracked_map.trackedMap.html",
|
|
128
|
-
"PeerDiscovery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscovery.html",
|
|
129
|
-
"./peer-discovery:PeerDiscovery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscovery.html",
|
|
130
|
-
"PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscoveryEvents.html",
|
|
131
|
-
"./peer-discovery:PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscoveryEvents.html",
|
|
132
|
-
"peerDiscovery": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_discovery.peerDiscovery-1.html",
|
|
133
|
-
"./peer-discovery:peerDiscovery": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_discovery.peerDiscovery-1.html",
|
|
134
|
-
"Ed25519PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Ed25519PeerId.html",
|
|
135
|
-
"./peer-id:Ed25519PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Ed25519PeerId.html",
|
|
136
|
-
"RSAPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.RSAPeerId.html",
|
|
137
|
-
"./peer-id:RSAPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.RSAPeerId.html",
|
|
138
|
-
"Secp256k1PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Secp256k1PeerId.html",
|
|
139
|
-
"./peer-id:Secp256k1PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Secp256k1PeerId.html",
|
|
140
|
-
"PeerId": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerId.html",
|
|
141
|
-
"./peer-id:PeerId": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerId.html",
|
|
142
|
-
"PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerIdType.html",
|
|
143
|
-
"./peer-id:PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerIdType.html",
|
|
144
|
-
"./peer-id:symbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_id.symbol.html",
|
|
145
|
-
"isPeerId": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.peer_id.isPeerId.html",
|
|
146
|
-
"./peer-id:isPeerId": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.peer_id.isPeerId.html",
|
|
147
|
-
"PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_info.PeerInfo.html",
|
|
148
|
-
"./peer-info:PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_info.PeerInfo.html",
|
|
149
|
-
"PeerRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_routing.PeerRouting.html",
|
|
150
|
-
"./peer-routing:PeerRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_routing.PeerRouting.html",
|
|
151
|
-
"peerRouting": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_routing.peerRouting-1.html",
|
|
152
|
-
"./peer-routing:peerRouting": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_routing.peerRouting-1.html",
|
|
153
|
-
"Address": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Address.html",
|
|
154
|
-
"./peer-store:Address": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Address.html",
|
|
155
|
-
"Peer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Peer.html",
|
|
156
|
-
"./peer-store:Peer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Peer.html",
|
|
157
|
-
"PeerData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerData.html",
|
|
158
|
-
"./peer-store:PeerData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerData.html",
|
|
159
|
-
"PeerQuery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQuery.html",
|
|
160
|
-
"./peer-store:PeerQuery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQuery.html",
|
|
161
|
-
"PeerQueryFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryFilter.html",
|
|
162
|
-
"./peer-store:PeerQueryFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryFilter.html",
|
|
163
|
-
"PeerQueryOrder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryOrder.html",
|
|
164
|
-
"./peer-store:PeerQueryOrder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryOrder.html",
|
|
165
|
-
"PeerStore": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerStore.html",
|
|
166
|
-
"./peer-store:PeerStore": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerStore.html",
|
|
167
|
-
"Tag": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Tag.html",
|
|
168
|
-
"./peer-store:Tag": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Tag.html",
|
|
169
|
-
"TagOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.TagOptions.html",
|
|
170
|
-
"./peer-store:TagOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.TagOptions.html",
|
|
171
|
-
"KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_store_tags.KEEP_ALIVE.html",
|
|
172
|
-
"./peer-store/tags:KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_store_tags.KEEP_ALIVE.html",
|
|
173
|
-
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.pubsub.TopicValidatorResult.html",
|
|
174
|
-
"./pubsub:TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.pubsub.TopicValidatorResult.html",
|
|
175
|
-
"PeerStreamEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreamEvents.html",
|
|
176
|
-
"./pubsub:PeerStreamEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreamEvents.html",
|
|
177
|
-
"PeerStreams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreams.html",
|
|
178
|
-
"./pubsub:PeerStreams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreams.html",
|
|
179
|
-
"PubSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSub.html",
|
|
180
|
-
"./pubsub:PubSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSub.html",
|
|
181
|
-
"PubSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubEvents.html",
|
|
182
|
-
"./pubsub:PubSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubEvents.html",
|
|
183
|
-
"PubSubInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubInit.html",
|
|
184
|
-
"./pubsub:PubSubInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubInit.html",
|
|
185
|
-
"PubSubRPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPC.html",
|
|
186
|
-
"./pubsub:PubSubRPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPC.html",
|
|
187
|
-
"PubSubRPCMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCMessage.html",
|
|
188
|
-
"./pubsub:PubSubRPCMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCMessage.html",
|
|
189
|
-
"PubSubRPCSubscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCSubscription.html",
|
|
190
|
-
"./pubsub:PubSubRPCSubscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCSubscription.html",
|
|
191
|
-
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PublishResult.html",
|
|
192
|
-
"./pubsub:PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PublishResult.html",
|
|
193
|
-
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SignedMessage.html",
|
|
194
|
-
"./pubsub:SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SignedMessage.html",
|
|
195
|
-
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SubscriptionChangeData.html",
|
|
196
|
-
"./pubsub:SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SubscriptionChangeData.html",
|
|
197
|
-
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.TopicValidatorFn.html",
|
|
198
|
-
"./pubsub:TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.TopicValidatorFn.html",
|
|
199
|
-
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.UnsignedMessage.html",
|
|
200
|
-
"./pubsub:UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.UnsignedMessage.html",
|
|
201
|
-
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.Message.html",
|
|
202
|
-
"./pubsub:Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.Message.html",
|
|
203
|
-
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.SignaturePolicy.html",
|
|
204
|
-
"./pubsub:SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.SignaturePolicy.html",
|
|
205
|
-
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictNoSign.html",
|
|
206
|
-
"./pubsub:StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictNoSign.html",
|
|
207
|
-
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictSign.html",
|
|
208
|
-
"./pubsub:StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictSign.html",
|
|
209
|
-
"Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Envelope.html",
|
|
210
|
-
"./record:Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Envelope.html",
|
|
211
|
-
"Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Record.html",
|
|
212
|
-
"./record:Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Record.html",
|
|
213
|
-
"Startable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.startable.Startable.html",
|
|
214
|
-
"./startable:Startable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.startable.Startable.html",
|
|
215
|
-
"isStartable": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.isStartable.html",
|
|
216
|
-
"./startable:isStartable": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.isStartable.html",
|
|
217
|
-
"start": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.start.html",
|
|
218
|
-
"./startable:start": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.start.html",
|
|
219
|
-
"stop": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.stop.html",
|
|
220
|
-
"./startable:stop": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.stop.html",
|
|
221
|
-
"IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.IncomingStreamData.html",
|
|
222
|
-
"./stream-handler:IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.IncomingStreamData.html",
|
|
223
|
-
"StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandler.html",
|
|
224
|
-
"./stream-handler:StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandler.html",
|
|
225
|
-
"StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerOptions.html",
|
|
226
|
-
"./stream-handler:StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerOptions.html",
|
|
227
|
-
"StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerRecord.html",
|
|
228
|
-
"./stream-handler:StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerRecord.html",
|
|
229
|
-
"StreamMuxer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxer.html",
|
|
230
|
-
"./stream-muxer:StreamMuxer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxer.html",
|
|
231
|
-
"StreamMuxerFactory": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerFactory.html",
|
|
232
|
-
"./stream-muxer:StreamMuxerFactory": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerFactory.html",
|
|
233
|
-
"StreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerInit.html",
|
|
234
|
-
"./stream-muxer:StreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerInit.html",
|
|
235
|
-
"AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.stream_muxer_stream.AbstractStream.html",
|
|
236
|
-
"./stream-muxer/stream:AbstractStream": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.stream_muxer_stream.AbstractStream.html",
|
|
237
|
-
"AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer_stream.AbstractStreamInit.html",
|
|
238
|
-
"./stream-muxer/stream:AbstractStreamInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer_stream.AbstractStreamInit.html",
|
|
239
|
-
"FaultTolerance": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.transport.FaultTolerance.html",
|
|
240
|
-
"./transport:FaultTolerance": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.transport.FaultTolerance.html",
|
|
241
|
-
"ConnectionHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ConnectionHandler.html",
|
|
242
|
-
"./transport:ConnectionHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ConnectionHandler.html",
|
|
243
|
-
"CreateListenerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.CreateListenerOptions.html",
|
|
244
|
-
"./transport:CreateListenerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.CreateListenerOptions.html",
|
|
245
|
-
"DialOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.DialOptions.html",
|
|
246
|
-
"./transport:DialOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.DialOptions.html",
|
|
247
|
-
"Listener": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Listener.html",
|
|
248
|
-
"./transport:Listener": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Listener.html",
|
|
249
|
-
"ListenerEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ListenerEvents.html",
|
|
250
|
-
"./transport:ListenerEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ListenerEvents.html",
|
|
251
|
-
"MultiaddrFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.MultiaddrFilter.html",
|
|
252
|
-
"./transport:MultiaddrFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.MultiaddrFilter.html",
|
|
253
|
-
"Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Transport.html",
|
|
254
|
-
"./transport:Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Transport.html",
|
|
255
|
-
"Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Upgrader.html",
|
|
256
|
-
"./transport:Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Upgrader.html",
|
|
257
|
-
"UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.UpgraderOptions.html",
|
|
258
|
-
"./transport:UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.UpgraderOptions.html",
|
|
259
|
-
"./transport:symbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.transport.symbol.html",
|
|
260
|
-
"isTransport": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.transport.isTransport.html",
|
|
261
|
-
"./transport:isTransport": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.transport.isTransport.html"
|
|
262
|
-
}
|
package/src/keychain/index.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
*
|
|
4
|
-
* The libp2p keychain provides an API to store keys in a datastore in
|
|
5
|
-
* an encrypted format.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { createLibp2p } from 'libp2p'
|
|
11
|
-
* import { FsDatastore } from 'datastore-fs'
|
|
12
|
-
*
|
|
13
|
-
* const node = await createLibp2p({
|
|
14
|
-
* datastore: new FsDatastore('/path/to/dir')
|
|
15
|
-
* })
|
|
16
|
-
*
|
|
17
|
-
* const info = await node.keychain.createKey('my-new-key', 'Ed25519')
|
|
18
|
-
*
|
|
19
|
-
* console.info(info) // { id: '...', name: 'my-new-key' }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import type { KeyType } from '../keys/index.js'
|
|
24
|
-
import type { PeerId } from '../peer-id/index.js'
|
|
25
|
-
import type { Multibase } from 'multiformats/bases/interface'
|
|
26
|
-
|
|
27
|
-
export interface KeyInfo {
|
|
28
|
-
/**
|
|
29
|
-
* The universally unique key id
|
|
30
|
-
*/
|
|
31
|
-
id: string
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The local key name
|
|
35
|
-
*/
|
|
36
|
-
name: string
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface KeyChain {
|
|
40
|
-
/**
|
|
41
|
-
* Export an existing key as a PEM encrypted PKCS #8 string.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
*
|
|
45
|
-
* ```js
|
|
46
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
47
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
exportKey(name: string, password: string): Promise<Multibase<'m'>>
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Import a new key from a PEM encoded PKCS #8 string.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
*
|
|
57
|
-
* ```js
|
|
58
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
59
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
60
|
-
* const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
importKey(name: string, pem: string, password: string): Promise<KeyInfo>
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Import a new key from a PeerId with a private key component
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
*
|
|
70
|
-
* ```js
|
|
71
|
-
* const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
importPeer(name: string, peerId: PeerId): Promise<KeyInfo>
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Export an existing key as a PeerId
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
*
|
|
81
|
-
* ```js
|
|
82
|
-
* const peerId = await libp2p.keychain.exportPeerId('key-name')
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
exportPeerId(name: string): Promise<PeerId>
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Create a key in the keychain.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
*
|
|
92
|
-
* ```js
|
|
93
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
createKey(name: string, type: KeyType, size?: number): Promise<KeyInfo>
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* List all the keys.
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
*
|
|
103
|
-
* ```js
|
|
104
|
-
* const keyInfos = await libp2p.keychain.listKeys()
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
listKeys(): Promise<KeyInfo[]>
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Removes a key from the keychain.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
*
|
|
114
|
-
* ```js
|
|
115
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
116
|
-
* const keyInfo = await libp2p.keychain.removeKey('keyTest')
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
removeKey(name: string): Promise<KeyInfo>
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Rename a key in the keychain.
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
*
|
|
126
|
-
* ```js
|
|
127
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
128
|
-
* const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
renameKey(oldName: string, newName: string): Promise<KeyInfo>
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Find a key by it's id.
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
*
|
|
138
|
-
* ```js
|
|
139
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
140
|
-
* const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id)
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
findKeyById(id: string): Promise<KeyInfo>
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Find a key by it's name.
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
*
|
|
150
|
-
* ```js
|
|
151
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
152
|
-
* const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest')
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
findKeyByName(name: string): Promise<KeyInfo>
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Rotate keychain password and re-encrypt all associated keys
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
*
|
|
162
|
-
* ```js
|
|
163
|
-
* await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
164
|
-
* ```
|
|
165
|
-
*/
|
|
166
|
-
rotateKeychainPass(oldPass: string, newPass: string): Promise<void>
|
|
167
|
-
}
|