Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@libp2p/interface

Package Overview
Dependencies
Maintainers
6
Versions
535
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/interface - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1-b248eefc0

19

dist/src/index.d.ts

@@ -51,2 +51,12 @@ /**

}
export interface TLSCertificate {
/**
* The private key that corresponds to the certificate in PEM format
*/
key: string;
/**
* The certificate chain in PEM format
*/
cert: string;
}
/**

@@ -244,2 +254,11 @@ * Data returned from a successful identify response

/**
* This event notifies listeners that a TLS certificate is available for use
*/
'certificate:provision': CustomEvent<TLSCertificate>;
/**
* This event notifies listeners that a new TLS certificate is available for
* use. Any previous certificate may no longer be valid.
*/
'certificate:renew': CustomEvent<TLSCertificate>;
/**
* This event notifies listeners that the node has started

@@ -246,0 +265,0 @@ *

31

dist/src/transport/index.d.ts

@@ -8,5 +8,15 @@ import type { Connection, ConnectionLimits, MultiaddrConnection } from '../connection/index.js';

export interface ListenerEvents {
'connection': CustomEvent<Connection>;
/**
* This event signals to the transport manager that the listening addresses
* have changed and may be emitted at any point and/or multiple times
*/
'listening': CustomEvent;
/**
* Emitted if listening on an address failed
*/
'error': CustomEvent<Error>;
/**
* Emitted when the listener has been shut down, has no open connections and
* will no longer accept new connections
*/
'close': CustomEvent;

@@ -31,5 +41,2 @@ }

export declare const transportSymbol: unique symbol;
export interface ConnectionHandler {
(connection: Connection): void;
}
export interface MultiaddrFilter {

@@ -39,6 +46,13 @@ (multiaddrs: Multiaddr[]): Multiaddr[];

export interface CreateListenerOptions {
handler?: ConnectionHandler;
/**
* The upgrader turns a MultiaddrConnection into a Connection and notifies
* other libp2p components about a new incoming connection.
*/
upgrader: Upgrader;
}
export interface DialTransportOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> {
/**
* The upgrader turns a MultiaddrConnection into a Connection which should be
* returned by the transport's dial method
*/
upgrader: Upgrader;

@@ -101,10 +115,11 @@ }

/**
* Upgrades an outbound connection on `transport.dial`.
* Upgrades an outbound connection created by the `dial` method of a transport
*/
upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<OutboundConnectionUpgradeEvents>): Promise<Connection>;
/**
* Upgrades an inbound connection on transport listener.
* Upgrades an inbound connection received by a transport listener and
* notifies other libp2p components about the new connection
*/
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<Connection>;
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<void>;
}
//# sourceMappingURL=index.d.ts.map
{
"name": "@libp2p/interface",
"version": "2.2.0",
"version": "2.2.1-b248eefc0",
"description": "The interface implemented by a libp2p node",

@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT",

@@ -56,2 +56,14 @@ /**

export interface TLSCertificate {
/**
* The private key that corresponds to the certificate in PEM format
*/
key: string
/**
* The certificate chain in PEM format
*/
cert: string
}
/**

@@ -272,2 +284,13 @@ * Data returned from a successful identify response

/**
* This event notifies listeners that a TLS certificate is available for use
*/
'certificate:provision': CustomEvent<TLSCertificate>
/**
* This event notifies listeners that a new TLS certificate is available for
* use. Any previous certificate may no longer be valid.
*/
'certificate:renew': CustomEvent<TLSCertificate>
/**
* This event notifies listeners that the node has started

@@ -274,0 +297,0 @@ *

@@ -9,5 +9,17 @@ import type { Connection, ConnectionLimits, MultiaddrConnection } from '../connection/index.js'

export interface ListenerEvents {
'connection': CustomEvent<Connection>
/**
* This event signals to the transport manager that the listening addresses
* have changed and may be emitted at any point and/or multiple times
*/
'listening': CustomEvent
/**
* Emitted if listening on an address failed
*/
'error': CustomEvent<Error>
/**
* Emitted when the listener has been shut down, has no open connections and
* will no longer accept new connections
*/
'close': CustomEvent

@@ -35,8 +47,9 @@ }

export interface ConnectionHandler { (connection: Connection): void }
export interface MultiaddrFilter { (multiaddrs: Multiaddr[]): Multiaddr[] }
export interface CreateListenerOptions {
handler?: ConnectionHandler
/**
* The upgrader turns a MultiaddrConnection into a Connection and notifies
* other libp2p components about a new incoming connection.
*/
upgrader: Upgrader

@@ -46,2 +59,6 @@ }

export interface DialTransportOptions<DialEvents extends ProgressEvent = ProgressEvent> extends AbortOptions, ProgressOptions<DialEvents> {
/**
* The upgrader turns a MultiaddrConnection into a Connection which should be
* returned by the transport's dial method
*/
upgrader: Upgrader

@@ -123,3 +140,3 @@ }

/**
* Upgrades an outbound connection on `transport.dial`.
* Upgrades an outbound connection created by the `dial` method of a transport
*/

@@ -129,5 +146,6 @@ upgradeOutbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<OutboundConnectionUpgradeEvents>): Promise<Connection>

/**
* Upgrades an inbound connection on transport listener.
* Upgrades an inbound connection received by a transport listener and
* notifies other libp2p components about the new connection
*/
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<Connection>
upgradeInbound(maConn: MultiaddrConnection, opts?: UpgraderOptions<InboundConnectionUpgradeEvents>): Promise<void>
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc