UNPKG

@waku/enr

Version:
59 lines (58 loc) 2.63 kB
import type { Multiaddr } from "@multiformats/multiaddr"; import type { ENRKey, ENRValue, SequenceNumber, ShardInfo, Waku2 } from "@waku/interfaces"; export declare class RawEnr extends Map<ENRKey, ENRValue> { seq: SequenceNumber; signature?: Uint8Array; protected constructor(kvs?: Record<ENRKey, ENRValue>, seq?: SequenceNumber, signature?: Uint8Array); set(k: ENRKey, v: ENRValue): this; get id(): string; get publicKey(): Uint8Array | undefined; get rs(): ShardInfo | undefined; get rsv(): ShardInfo | undefined; get ip(): string | undefined; set ip(ip: string | undefined); get tcp(): number | undefined; set tcp(port: number | undefined); get udp(): number | undefined; set udp(port: number | undefined); get ip6(): string | undefined; set ip6(ip: string | undefined); get tcp6(): number | undefined; set tcp6(port: number | undefined); get udp6(): number | undefined; set udp6(port: number | undefined); /** * Get the `multiaddrs` field from ENR. * * This field is used to store multiaddresses that cannot be stored with the current ENR pre-defined keys. * These can be a multiaddresses that include encapsulation (e.g. wss) or do not use `ip4` nor `ip6` for the host * address (e.g. `dns4`, `dnsaddr`, etc).. * * If the peer information only contains information that can be represented with the ENR pre-defined keys * (ip, tcp, etc) then the usage of { @link ENR.getLocationMultiaddr } should be preferred. * * The multiaddresses stored in this field are expected to be location multiaddresses, ie, peer id less. */ get multiaddrs(): Multiaddr[] | undefined; /** * Set the `multiaddrs` field on the ENR. * * This field is used to store multiaddresses that cannot be stored with the current ENR pre-defined keys. * These can be a multiaddresses that include encapsulation (e.g. wss) or do not use `ip4` nor `ip6` for the host * address (e.g. `dns4`, `dnsaddr`, etc).. * * If the peer information only contains information that can be represented with the ENR pre-defined keys * (ip, tcp, etc) then the usage of { @link ENR.setLocationMultiaddr } should be preferred. * The multiaddresses stored in this field must be location multiaddresses, * ie, without a peer id. */ set multiaddrs(multiaddrs: Multiaddr[] | undefined); /** * Get the `waku2` field from ENR. */ get waku2(): Waku2 | undefined; /** * Set the `waku2` field on the ENR. */ set waku2(waku2: Waku2 | undefined); }