You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@libp2p/interface

Package Overview
Dependencies
Maintainers
6
Versions
694
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

to
2.10.5-57e7fa441

21

dist/src/index.d.ts

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

import type { Listener, OutboundConnectionUpgradeEvents } from './transport.js';
import type { DNS } from '@multiformats/dns';
import type { Multiaddr } from '@multiformats/multiaddr';

@@ -159,3 +160,23 @@ import type { TypedEventTarget } from 'main-event';

}
export interface MultiaddrResolveOptions extends AbortOptions, LoggerOptions {
/**
* An optional DNS resolver
*/
dns?: DNS;
}
/**
* `MultiaddrResolver`s perform resolution of multiaddr components that require
* translation by external systems (for example DNSADDR to TXT records).
*/
export interface MultiaddrResolver {
/**
* Returns true if this resolver can resolve components of this multiaddr
*/
canResolve(address: Multiaddr): boolean;
/**
* Returns one or more multiaddrs with components resolved to other values
*/
resolve(address: Multiaddr, options: MultiaddrResolveOptions): Promise<Multiaddr[]>;
}
/**
* Once you have a libp2p instance, you can listen to several events it emits,

@@ -162,0 +183,0 @@ * so that you can be notified of relevant network events.

3

package.json
{
"name": "@libp2p/interface",
"version": "2.10.4",
"version": "2.10.5-57e7fa441",
"description": "The interface implemented by a libp2p node",

@@ -44,2 +44,3 @@ "license": "Apache-2.0 OR MIT",

"dependencies": {
"@multiformats/dns": "^1.0.6",
"@multiformats/multiaddr": "^12.4.4",

@@ -46,0 +47,0 @@ "it-pushable": "^3.2.3",

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

import type { Listener, OutboundConnectionUpgradeEvents } from './transport.js'
import type { DNS } from '@multiformats/dns'
import type { Multiaddr } from '@multiformats/multiaddr'

@@ -177,3 +178,26 @@ import type { TypedEventTarget } from 'main-event'

export interface MultiaddrResolveOptions extends AbortOptions, LoggerOptions {
/**
* An optional DNS resolver
*/
dns?: DNS
}
/**
* `MultiaddrResolver`s perform resolution of multiaddr components that require
* translation by external systems (for example DNSADDR to TXT records).
*/
export interface MultiaddrResolver {
/**
* Returns true if this resolver can resolve components of this multiaddr
*/
canResolve (address: Multiaddr): boolean
/**
* Returns one or more multiaddrs with components resolved to other values
*/
resolve (address: Multiaddr, options: MultiaddrResolveOptions): Promise<Multiaddr[]>
}
/**
* Once you have a libp2p instance, you can listen to several events it emits,

@@ -180,0 +204,0 @@ * so that you can be notified of relevant network events.

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