MultiAddr class

Represents a multiaddress

Available extensions

Constructors

MultiAddr(String addr)
Creates a new Multiaddr from a string Format: /protocol1/value1/protocol2/value2 Example: /ip4/127.0.0.1/tcp/1234

Properties

addressType → AddressType

Available on MultiAddr, provided by the MultiAddrClassification extension

Classifies the address type for prioritization
no setter
certhash → String?
Returns the certificate hash if present
no setter
components → List<(Protocol, String)>
Returns all protocol/value pairs in this multiaddr
no setter
dns4 → String?
Returns the DNS4 address if present
no setter
dns6 → String?
Returns the DNS6 address if present
no setter
dnsaddr → String?
Returns the DNS address if present
no setter
hasCircuit → bool
Returns true if P2P circuit protocol is present
no setter
hashCode → int
The hash code for this object.
no setteroverride
hasQuicV1 → bool
Returns true if QUIC-v1 protocol is present
no setter
hasUdx → bool
Protocol Flag Getters Returns true if UDX protocol is present
no setter
hasWebtransport → bool
Returns true if WebTransport protocol is present
no setter
ip → String?
Returns the first available IP address (IPv4 or IPv6)
no setter
ip4 → String?
Network Address Getters Returns the IPv4 address if present
no setter
ip6 → String?
Returns the IPv6 address if present
no setter
ipv6Prefix64 → String?

Available on MultiAddr, provided by the MultiAddrClassification extension

Extract /64 prefix for IPv6 deduplication Returns null if not an IPv6 address
no setter
peerId → String?
Identity and Path Getters Returns the peer ID if present
no setter
port → int?
Returns the first available port number (TCP or UDP)
no setter
protocols → List<Protocol>
Returns all protocols in this multiaddr
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sni → String?
Returns the SNI value if present
no setter
tcpPort → int?
Port Getters Returns the TCP port number if present
no setter
transports → List<String>
Returns all transport protocols present in this multiaddr
no setter
udpPort → int?
Returns the UDP port number if present
no setter
unixPath → String?
Returns the Unix path if present
no setter
values → List<String>
Returns all values in this multiaddr
no setter

Methods

decapsulate(String protocol) → MultiAddr?
Decapsulates the last protocol/value pair from this multiaddr
encapsulate(String protocolName, String value) → MultiAddr
Encapsulates this multiaddr with another protocol/value pair
equals(MultiAddr addr) → bool
hasProtocol(String protocol) → bool
isLoopback() → bool
isPrivate() → bool
isPublic() → bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBytes() → Uint8List
toIP() → InternetAddress?
toString() → String
A string representation of this object.
override
valueForProtocol(String protocol) → String?

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromBytes(Uint8List bytes) → MultiAddr
Creates a Multiaddr from bytes