🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@libp2p/interface

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/interface - npm Package Compare versions

Comparing version

to
2.10.3-ae595d8db

(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PInterface = factory()}(typeof self !== 'undefined' ? self : this, function () {
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},Z=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of W(r))!X.call(t,o)&&o!==e&&n(t,o,{get:()=>r[o],enumerable:!(s=V(r,o))||s.enumerable});return t};var $=t=>Z(n({},"__esModule",{value:!0}),t);var fr={};Y(fr,{AbortError:()=>c,AlreadyStartedError:()=>M,ConnectionClosedError:()=>E,ConnectionClosingError:()=>f,ConnectionFailedError:()=>h,DialError:()=>N,FaultTolerance:()=>i,InvalidCIDError:()=>P,InvalidCryptoExchangeError:()=>l,InvalidMessageError:()=>C,InvalidMultiaddrError:()=>g,InvalidMultihashError:()=>A,InvalidParametersError:()=>u,InvalidPeerIdError:()=>I,InvalidPrivateKeyError:()=>x,InvalidPublicKeyError:()=>m,KEEP_ALIVE:()=>nr,LimitedConnectionError:()=>K,ListenError:()=>U,MuxerClosedError:()=>b,NotFoundError:()=>v,NotImplementedError:()=>F,NotStartedError:()=>D,ProtocolError:()=>w,StreamResetError:()=>S,StreamStateError:()=>y,StrictNoSign:()=>ir,StrictSign:()=>ar,TimeoutError:()=>T,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>_,TopicValidatorResult:()=>a,TypedEventEmitter:()=>O,UnexpectedPeerError:()=>p,UnsupportedKeyTypeError:()=>B,UnsupportedOperationError:()=>d,UnsupportedProtocolError:()=>L,connectionSymbol:()=>q,contentRoutingSymbol:()=>rr,isConnection:()=>k,isPeerId:()=>or,isPrivateKey:()=>tr,isPubSub:()=>cr,isPublicKey:()=>z,isStartable:()=>j,isTransport:()=>pr,peerDiscoverySymbol:()=>er,peerIdSymbol:()=>G,peerRoutingSymbol:()=>sr,pubSubSymbol:()=>H,serviceCapabilities:()=>xr,serviceDependencies:()=>dr,setMaxListeners:()=>lr,start:()=>ur,stop:()=>mr,transportSymbol:()=>J});var q=Symbol.for("@libp2p/connection");function k(t){return t!=null&&!!t[q]}var rr=Symbol.for("@libp2p/content-routing");function z(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function tr(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&z(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var er=Symbol.for("@libp2p/peer-discovery");var G=Symbol.for("@libp2p/peer-id");function or(t){return!!t?.[G]}var sr=Symbol.for("@libp2p/peer-routing");var nr="keep-alive";var ar="StrictSign",ir="StrictNoSign",a;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(a||(a={}));var H=Symbol.for("@libp2p/pubsub");function cr(t){return!!t?.[H]}var J=Symbol.for("@libp2p/transport");function pr(t){return t!=null&&!!t[J]}var i;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(i||(i={}));var c=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},p=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},l=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},u=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},m=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},x=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},d=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},f=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},E=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},h=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},b=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},y=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},v=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},I=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},g=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},P=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},A=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},L=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},C=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},w=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},T=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},D=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},M=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},N=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},U=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},K=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},_=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},B=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},F=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};function lr(){}var O=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){super.addEventListener(r,e,s);let o=this.#r.get(r);o==null&&(o=[],this.#r.set(r,o)),o.push({callback:e,once:(s!==!0&&s!==!1&&s?.once)??!1})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:Q})=>Q!==e),this.#r.set(r,o))}dispatchEvent(r){let e=super.dispatchEvent(r),s=this.#r.get(r.type);return s==null||(s=s.filter(({once:o})=>!o),this.#r.set(r.type,s)),e}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};function j(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function ur(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function mr(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var xr=Symbol.for("@libp2p/service-capabilities"),dr=Symbol.for("@libp2p/service-dependencies");return $(fr);})();
"use strict";var Libp2PInterface=(()=>{var n=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.prototype.hasOwnProperty;var Z=(t,r)=>{for(var e in r)n(t,e,{get:r[e],enumerable:!0})},$=(t,r,e,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of X(r))!Y.call(t,o)&&o!==e&&n(t,o,{get:()=>r[o],enumerable:!(s=W(r,o))||s.enumerable});return t};var k=t=>$(n({},"__esModule",{value:!0}),t);var fr={};Z(fr,{AbortError:()=>c,AlreadyStartedError:()=>M,ConnectionClosedError:()=>E,ConnectionClosingError:()=>f,ConnectionFailedError:()=>h,DialError:()=>N,FaultTolerance:()=>i,InvalidCIDError:()=>P,InvalidCryptoExchangeError:()=>l,InvalidMessageError:()=>C,InvalidMultiaddrError:()=>g,InvalidMultihashError:()=>A,InvalidParametersError:()=>u,InvalidPeerIdError:()=>I,InvalidPrivateKeyError:()=>x,InvalidPublicKeyError:()=>m,KEEP_ALIVE:()=>ar,LimitedConnectionError:()=>K,ListenError:()=>U,MuxerClosedError:()=>b,NotFoundError:()=>v,NotImplementedError:()=>F,NotStartedError:()=>D,ProtocolError:()=>w,StreamResetError:()=>S,StreamStateError:()=>y,StrictNoSign:()=>cr,StrictSign:()=>ir,TimeoutError:()=>T,TooManyInboundProtocolStreamsError:()=>R,TooManyOutboundProtocolStreamsError:()=>_,TopicValidatorResult:()=>a,TypedEventEmitter:()=>O,UnexpectedPeerError:()=>p,UnsupportedKeyTypeError:()=>B,UnsupportedOperationError:()=>d,UnsupportedProtocolError:()=>L,connectionSymbol:()=>q,contentRoutingSymbol:()=>tr,isConnection:()=>rr,isPeerId:()=>sr,isPrivateKey:()=>er,isPubSub:()=>pr,isPublicKey:()=>z,isStartable:()=>j,isTransport:()=>lr,peerDiscoverySymbol:()=>or,peerIdSymbol:()=>G,peerRoutingSymbol:()=>nr,pubSubSymbol:()=>H,serviceCapabilities:()=>xr,serviceDependencies:()=>dr,setMaxListeners:()=>Q,start:()=>ur,stop:()=>mr,transportSymbol:()=>J});var q=Symbol.for("@libp2p/connection");function rr(t){return t!=null&&!!t[q]}var tr=Symbol.for("@libp2p/content-routing");function z(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.toMultihash=="function"&&typeof t.toCID=="function"&&typeof t.verify=="function"}function er(t){return t==null?!1:(t.type==="RSA"||t.type==="Ed25519"||t.type==="secp256k1"||t.type==="ECDSA")&&z(t.publicKey)&&t.raw instanceof Uint8Array&&typeof t.equals=="function"&&typeof t.sign=="function"}var or=Symbol.for("@libp2p/peer-discovery");var G=Symbol.for("@libp2p/peer-id");function sr(t){return!!t?.[G]}var nr=Symbol.for("@libp2p/peer-routing");var ar="keep-alive";var ir="StrictSign",cr="StrictNoSign",a;(function(t){t.Accept="accept",t.Ignore="ignore",t.Reject="reject"})(a||(a={}));var H=Symbol.for("@libp2p/pubsub");function pr(t){return!!t?.[H]}var J=Symbol.for("@libp2p/transport");function lr(t){return t!=null&&!!t[J]}var i;(function(t){t[t.FATAL_ALL=0]="FATAL_ALL",t[t.NO_FATAL=1]="NO_FATAL"})(i||(i={}));var c=class extends Error{static name="AbortError";constructor(r="The operation was aborted"){super(r),this.name="AbortError"}},p=class extends Error{static name="UnexpectedPeerError";constructor(r="Unexpected Peer"){super(r),this.name="UnexpectedPeerError"}},l=class extends Error{static name="InvalidCryptoExchangeError";constructor(r="Invalid crypto exchange"){super(r),this.name="InvalidCryptoExchangeError"}},u=class extends Error{static name="InvalidParametersError";constructor(r="Invalid parameters"){super(r),this.name="InvalidParametersError"}},m=class extends Error{static name="InvalidPublicKeyError";constructor(r="Invalid public key"){super(r),this.name="InvalidPublicKeyError"}},x=class extends Error{static name="InvalidPrivateKeyError";constructor(r="Invalid private key"){super(r),this.name="InvalidPrivateKeyError"}},d=class extends Error{static name="UnsupportedOperationError";constructor(r="Unsupported operation"){super(r),this.name="UnsupportedOperationError"}},f=class extends Error{static name="ConnectionClosingError";constructor(r="The connection is closing"){super(r),this.name="ConnectionClosingError"}},E=class extends Error{static name="ConnectionClosedError";constructor(r="The connection is closed"){super(r),this.name="ConnectionClosedError"}},h=class extends Error{static name="ConnectionFailedError";constructor(r="Connection failed"){super(r),this.name="ConnectionFailedError"}},b=class extends Error{static name="MuxerClosedError";constructor(r="The muxer is closed"){super(r),this.name="MuxerClosedError"}},S=class extends Error{static name="StreamResetError";constructor(r="The stream has been reset"){super(r),this.name="StreamResetError"}},y=class extends Error{static name="StreamStateError";constructor(r="The stream is in an invalid state"){super(r),this.name="StreamStateError"}},v=class extends Error{static name="NotFoundError";constructor(r="Not found"){super(r),this.name="NotFoundError"}},I=class extends Error{static name="InvalidPeerIdError";constructor(r="Invalid PeerID"){super(r),this.name="InvalidPeerIdError"}},g=class extends Error{static name="InvalidMultiaddrError";constructor(r="Invalid multiaddr"){super(r),this.name="InvalidMultiaddrError"}},P=class extends Error{static name="InvalidCIDError";constructor(r="Invalid CID"){super(r),this.name="InvalidCIDError"}},A=class extends Error{static name="InvalidMultihashError";constructor(r="Invalid Multihash"){super(r),this.name="InvalidMultihashError"}},L=class extends Error{static name="UnsupportedProtocolError";constructor(r="Unsupported protocol error"){super(r),this.name="UnsupportedProtocolError"}},C=class extends Error{static name="InvalidMessageError";constructor(r="Invalid message"){super(r),this.name="InvalidMessageError"}},w=class extends Error{static name="ProtocolError";constructor(r="Protocol error"){super(r),this.name="ProtocolError"}},T=class extends Error{static name="TimeoutError";constructor(r="Timed out"){super(r),this.name="TimeoutError"}},D=class extends Error{static name="NotStartedError";constructor(r="Not started"){super(r),this.name="NotStartedError"}},M=class extends Error{static name="AlreadyStartedError";constructor(r="Already started"){super(r),this.name="AlreadyStartedError"}},N=class extends Error{static name="DialError";constructor(r="Dial error"){super(r),this.name="DialError"}},U=class extends Error{static name="ListenError";constructor(r="Listen error"){super(r),this.name="ListenError"}},K=class extends Error{static name="LimitedConnectionError";constructor(r="Limited connection"){super(r),this.name="LimitedConnectionError"}},R=class extends Error{static name="TooManyInboundProtocolStreamsError";constructor(r="Too many inbound protocol streams"){super(r),this.name="TooManyInboundProtocolStreamsError"}},_=class extends Error{static name="TooManyOutboundProtocolStreamsError";constructor(r="Too many outbound protocol streams"){super(r),this.name="TooManyOutboundProtocolStreamsError"}},B=class extends Error{static name="UnsupportedKeyTypeError";constructor(r="Unsupported key type"){super(r),this.name="UnsupportedKeyTypeError"}},F=class extends Error{static name="NotImplementedError";constructor(r="Not implemented"){super(r),this.name="NotImplementedError"}};function Q(){}var O=class extends EventTarget{#r=new Map;constructor(){super()}listenerCount(r){let e=this.#r.get(r);return e==null?0:e.length}addEventListener(r,e,s){super.addEventListener(r,e,s);let o=this.#r.get(r);o==null&&(o=[],this.#r.set(r,o)),o.push({callback:e,once:(s!==!0&&s!==!1&&s?.once)??!1})}removeEventListener(r,e,s){super.removeEventListener(r.toString(),e??null,s);let o=this.#r.get(r);o!=null&&(o=o.filter(({callback:V})=>V!==e),this.#r.set(r,o))}dispatchEvent(r){let e=super.dispatchEvent(r),s=this.#r.get(r.type);return s==null||(s=s.filter(({once:o})=>!o),this.#r.set(r.type,s)),e}safeDispatchEvent(r,e={}){return this.dispatchEvent(new CustomEvent(r,e))}};function j(t){return t!=null&&typeof t.start=="function"&&typeof t.stop=="function"}async function ur(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStart!=null&&await e.beforeStart()})),await Promise.all(r.map(async e=>{await e.start()})),await Promise.all(r.map(async e=>{e.afterStart!=null&&await e.afterStart()}))}async function mr(...t){let r=[];for(let e of t)j(e)&&r.push(e);await Promise.all(r.map(async e=>{e.beforeStop!=null&&await e.beforeStop()})),await Promise.all(r.map(async e=>{await e.stop()})),await Promise.all(r.map(async e=>{e.afterStop!=null&&await e.afterStop()}))}var xr=Symbol.for("@libp2p/service-capabilities"),dr=Symbol.for("@libp2p/service-dependencies");return k(fr);})();
return Libp2PInterface}));
//# sourceMappingURL=index.min.js.map

@@ -18,3 +18,2 @@ /**

import type { ContentRouting } from './content-routing.js';
import type { TypedEventTarget } from './event-target.js';
import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.js';

@@ -31,2 +30,3 @@ import type { Metrics } from './metrics.js';

import type { Multiaddr } from '@multiformats/multiaddr';
import type { TypedEventTarget } from 'main-event';
import type { ProgressOptions, ProgressEvent } from 'progress-events';

@@ -619,3 +619,3 @@ /**

*/
unhandle(protocols: string[] | string): Promise<void>;
unhandle(protocols: string[] | string, options?: AbortOptions): Promise<void>;
/**

@@ -638,3 +638,3 @@ * Register a topology to be informed when peers are encountered that

*/
register(protocol: string, topology: Topology): Promise<string>;
register(protocol: string, topology: Topology, options?: AbortOptions): Promise<string>;
/**

@@ -789,5 +789,4 @@ * Unregister topology to no longer be informed when peers connect or

export * from './errors.js';
export * from './event-target.js';
export * from './events.js';
export * from 'main-event';
export * from './startable.js';
//# sourceMappingURL=index.d.ts.map

@@ -50,5 +50,4 @@ /**

export * from './errors.js';
export * from './event-target.js';
export * from './events.js';
export * from 'main-event';
export * from './startable.js';
//# sourceMappingURL=index.js.map

@@ -0,1 +1,2 @@

import type { AbortOptions } from './index.ts';
import type { CID } from 'multiformats/cid';

@@ -39,3 +40,3 @@ import type { MultihashDigest } from 'multiformats/hashes/interface';

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>;
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>;
/**

@@ -75,3 +76,3 @@ * Returns this key as a multihash with base58btc encoding

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>;
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>;
/**

@@ -111,3 +112,3 @@ * Returns this key as a multihash with base58btc encoding

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>;
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>;
/**

@@ -151,3 +152,3 @@ * Returns this key as a multihash with base58btc encoding

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>;
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>;
/**

@@ -192,3 +193,3 @@ * Returns this key as a multihash with base58btc encoding

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>;
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>;
}

@@ -216,3 +217,3 @@ export interface Ed25519PrivateKey {

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>;
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>;
}

@@ -240,3 +241,3 @@ export interface Secp256k1PrivateKey {

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>;
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>;
}

@@ -268,3 +269,3 @@ export interface ECDSAPrivateKey {

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>;
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>;
}

@@ -271,0 +272,0 @@ export type PrivateKey = RSAPrivateKey | Ed25519PrivateKey | Secp256k1PrivateKey | ECDSAPrivateKey;

@@ -1,3 +0,3 @@

import type { TypedEventTarget } from './event-target.js';
import type { PeerInfo } from './peer-info.js';
import type { TypedEventTarget } from 'main-event';
/**

@@ -4,0 +4,0 @@ * Any object that implements this Symbol as a property should return a

@@ -0,1 +1,2 @@

import type { AbortOptions } from './index.ts';
import type { PublicKey } from './keys.js';

@@ -132,3 +133,3 @@ import type { PeerId } from './peer-id.js';

*/
export interface PeerQuery {
export interface PeerQuery extends AbortOptions {
filters?: PeerQueryFilter[];

@@ -139,2 +140,5 @@ orders?: PeerQueryOrder[];

}
export interface ConsumePeerRecordOptions extends AbortOptions {
expectedPeer?: PeerId;
}
export interface PeerStore {

@@ -185,3 +189,3 @@ /**

*/
delete(peerId: PeerId): Promise<void>;
delete(peerId: PeerId, options?: AbortOptions): Promise<void>;
/**

@@ -200,3 +204,3 @@ * Returns true if the passed PeerId is in the peer store

*/
has(peerId: PeerId): Promise<boolean>;
has(peerId: PeerId, options?: AbortOptions): Promise<boolean>;
/**

@@ -212,3 +216,3 @@ * Returns all data stored for the passed PeerId

*/
get(peerId: PeerId): Promise<Peer>;
get(peerId: PeerId, options?: AbortOptions): Promise<Peer>;
/**

@@ -238,3 +242,3 @@ * Returns a PeerInfo object for the passed peer id. This is similar to `get`

*/
getInfo(peerId: PeerId): Promise<PeerInfo>;
getInfo(peerId: PeerId, options?: AbortOptions): Promise<PeerInfo>;
/**

@@ -251,3 +255,3 @@ * Adds a peer to the peer store, overwriting any existing data

*/
save(id: PeerId, data: PeerData): Promise<Peer>;
save(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>;
/**

@@ -264,3 +268,3 @@ * Adds a peer to the peer store, overwriting only the passed fields

*/
patch(id: PeerId, data: PeerData): Promise<Peer>;
patch(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>;
/**

@@ -277,3 +281,3 @@ * Adds a peer to the peer store, deeply merging any existing data.

*/
merge(id: PeerId, data: PeerData): Promise<Peer>;
merge(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>;
/**

@@ -292,4 +296,8 @@ * Unmarshal and verify a signed peer record, extract the multiaddrs and

*/
consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise<boolean>;
consumePeerRecord(buf: Uint8Array, options?: ConsumePeerRecordOptions): Promise<boolean>;
/**
* @deprecated Pass `expectedPeer` as a property of `options` instead
*/
consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId, options?: AbortOptions): Promise<boolean>;
}
//# sourceMappingURL=peer-store.d.ts.map
import type { Stream } from './connection.js';
import type { TypedEventTarget } from './event-target.js';
import type { PublicKey } from './keys.js';
import type { PeerId } from './peer-id.js';
import type { Pushable } from 'it-pushable';
import type { TypedEventTarget } from 'main-event';
import type { Uint8ArrayList } from 'uint8arraylist';

@@ -7,0 +7,0 @@ /**

import type { Connection, Stream } from './connection.js';
import type { AbortOptions } from './index.ts';
export interface IncomingStreamData {

@@ -18,3 +19,3 @@ /**

}
export interface StreamHandlerOptions {
export interface StreamHandlerOptions extends AbortOptions {
/**

@@ -21,0 +22,0 @@ * How many incoming streams can be open for this protocol at the same time on each connection

import type { Connection, ConnectionLimits, MultiaddrConnection } from './connection.js';
import type { TypedEventTarget } from './event-target.js';
import type { AbortOptions, ClearableSignal, ConnectionEncrypter } from './index.js';
import type { StreamMuxerFactory } from './stream-muxer.js';
import type { Multiaddr } from '@multiformats/multiaddr';
import type { TypedEventTarget } from 'main-event';
import type { ProgressOptions, ProgressEvent } from 'progress-events';

@@ -7,0 +7,0 @@ export interface ListenerEvents {

{
"name": "@libp2p/interface",
"version": "2.10.2",
"version": "2.10.3-ae595d8db",
"description": "The interface implemented by a libp2p node",

@@ -47,3 +47,4 @@ "license": "Apache-2.0 OR MIT",

"it-stream-types": "^2.0.2",
"multiformats": "^13.3.4",
"main-event": "^1.0.1",
"multiformats": "^13.3.6",
"progress-events": "^1.0.1",

@@ -53,11 +54,5 @@ "uint8arraylist": "^2.4.8"

"devDependencies": {
"aegir": "^47.0.6"
"aegir": "^47.0.14"
},
"browser": {
"./dist/src/events.js": "./dist/src/events.browser.js"
},
"react-native": {
"./dist/src/events.js": "./dist/src/events.browser.js"
},
"sideEffects": false
}

@@ -19,3 +19,2 @@ /**

import type { ContentRouting } from './content-routing.js'
import type { TypedEventTarget } from './event-target.js'
import type { Ed25519PublicKey, PublicKey, RSAPublicKey, Secp256k1PublicKey } from './keys.js'

@@ -32,2 +31,3 @@ import type { Metrics } from './metrics.js'

import type { Multiaddr } from '@multiformats/multiaddr'
import type { TypedEventTarget } from 'main-event'
import type { ProgressOptions, ProgressEvent } from 'progress-events'

@@ -690,3 +690,3 @@

*/
unhandle(protocols: string[] | string): Promise<void>
unhandle(protocols: string[] | string, options?: AbortOptions): Promise<void>

@@ -710,3 +710,3 @@ /**

*/
register(protocol: string, topology: Topology): Promise<string>
register(protocol: string, topology: Topology, options?: AbortOptions): Promise<string>

@@ -877,4 +877,3 @@ /**

export * from './errors.js'
export * from './event-target.js'
export * from './events.js'
export * from 'main-event'
export * from './startable.js'

@@ -0,1 +1,2 @@

import type { AbortOptions } from './index.ts'
import type { CID } from 'multiformats/cid'

@@ -47,3 +48,3 @@ import type { MultihashDigest } from 'multiformats/hashes/interface'

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>

@@ -90,3 +91,3 @@ /**

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>

@@ -133,3 +134,3 @@ /**

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>

@@ -181,3 +182,3 @@ /**

*/
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array): boolean | Promise<boolean>
verify(data: Uint8Array | Uint8ArrayList, sig: Uint8Array, options?: AbortOptions): boolean | Promise<boolean>

@@ -242,3 +243,3 @@ /**

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>
}

@@ -271,3 +272,3 @@

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>
}

@@ -300,3 +301,3 @@

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>
}

@@ -334,3 +335,3 @@

*/
sign(data: Uint8Array | Uint8ArrayList): Uint8Array | Promise<Uint8Array>
sign(data: Uint8Array | Uint8ArrayList, options?: AbortOptions): Uint8Array | Promise<Uint8Array>
}

@@ -337,0 +338,0 @@

@@ -1,3 +0,3 @@

import type { TypedEventTarget } from './event-target.js'
import type { PeerInfo } from './peer-info.js'
import type { TypedEventTarget } from 'main-event'

@@ -4,0 +4,0 @@ /**

@@ -0,1 +1,2 @@

import type { AbortOptions } from './index.ts'
import type { PublicKey } from './keys.js'

@@ -150,3 +151,3 @@ import type { PeerId } from './peer-id.js'

*/
export interface PeerQuery {
export interface PeerQuery extends AbortOptions {
filters?: PeerQueryFilter[]

@@ -158,2 +159,6 @@ orders?: PeerQueryOrder[]

export interface ConsumePeerRecordOptions extends AbortOptions {
expectedPeer?: PeerId
}
export interface PeerStore {

@@ -206,3 +211,3 @@ /**

*/
delete(peerId: PeerId): Promise<void>
delete(peerId: PeerId, options?: AbortOptions): Promise<void>

@@ -222,3 +227,3 @@ /**

*/
has(peerId: PeerId): Promise<boolean>
has(peerId: PeerId, options?: AbortOptions): Promise<boolean>

@@ -235,3 +240,3 @@ /**

*/
get(peerId: PeerId): Promise<Peer>
get(peerId: PeerId, options?: AbortOptions): Promise<Peer>

@@ -262,3 +267,3 @@ /**

*/
getInfo (peerId: PeerId): Promise<PeerInfo>
getInfo (peerId: PeerId, options?: AbortOptions): Promise<PeerInfo>

@@ -276,3 +281,3 @@ /**

*/
save(id: PeerId, data: PeerData): Promise<Peer>
save(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>

@@ -290,3 +295,3 @@ /**

*/
patch(id: PeerId, data: PeerData): Promise<Peer>
patch(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>

@@ -304,3 +309,3 @@ /**

*/
merge(id: PeerId, data: PeerData): Promise<Peer>
merge(id: PeerId, data: PeerData, options?: AbortOptions): Promise<Peer>

@@ -320,3 +325,8 @@ /**

*/
consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId): Promise<boolean>
consumePeerRecord(buf: Uint8Array, options?: ConsumePeerRecordOptions): Promise<boolean>
/**
* @deprecated Pass `expectedPeer` as a property of `options` instead
*/
consumePeerRecord(buf: Uint8Array, expectedPeer?: PeerId, options?: AbortOptions): Promise<boolean>
}
import type { Stream } from './connection.js'
import type { TypedEventTarget } from './event-target.js'
import type { PublicKey } from './keys.js'
import type { PeerId } from './peer-id.js'
import type { Pushable } from 'it-pushable'
import type { TypedEventTarget } from 'main-event'
import type { Uint8ArrayList } from 'uint8arraylist'

@@ -7,0 +7,0 @@

import type { Connection, Stream } from './connection.js'
import type { AbortOptions } from './index.ts'

@@ -22,3 +23,3 @@ export interface IncomingStreamData {

export interface StreamHandlerOptions {
export interface StreamHandlerOptions extends AbortOptions {
/**

@@ -25,0 +26,0 @@ * How many incoming streams can be open for this protocol at the same time on each connection

import type { Connection, ConnectionLimits, MultiaddrConnection } from './connection.js'
import type { TypedEventTarget } from './event-target.js'
import type { AbortOptions, ClearableSignal, ConnectionEncrypter } from './index.js'
import type { StreamMuxerFactory } from './stream-muxer.js'
import type { Multiaddr } from '@multiformats/multiaddr'
import type { TypedEventTarget } from 'main-event'
import type { ProgressOptions, ProgressEvent } from 'progress-events'

@@ -7,0 +7,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet