UNPKG

libp2p

Version:

JavaScript implementation of libp2p, a modular peer to peer network stack

14 lines 623 B
import type { IpNet } from '@chainsafe/netmask'; import type { Multiaddr } from '@multiformats/multiaddr'; /** * Converts a multiaddr string or object to an IpNet object. * If the multiaddr doesn't include /ipcidr, it will encapsulate with the appropriate CIDR: * - /ipcidr/32 for IPv4 * - /ipcidr/128 for IPv6 * * @param {string | Multiaddr} ma - The multiaddr string or object to convert. * @returns {IpNet} The converted IpNet object. * @throws {Error} Throws an error if the multiaddr is not valid. */ export declare function multiaddrToIpNet(ma: string | Multiaddr): IpNet; //# sourceMappingURL=utils.d.ts.map