Network class

Represents a CAIP-2 blockchain network identifier.

A CAIP-2 network is composed of:

  • a namespace (e.g. eip155, solana)
  • a reference (e.g. chain ID or genesis hash)

The canonical string form is <namespace>:<reference>.

Examples:

  • eip155:1 (Ethereum mainnet)
  • eip155:8453 (Base mainnet)
  • solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d

Instances are immutable and compare by value.

Constructors

Network({required String namespace, required String reference})
Creates a CAIP-2 network identifier.
const
Network.parse(String value)
Parses a CAIP-2 formatted string (<namespace>:<reference>).
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
identifier → String
Returns the CAIP-2 identifier string (<namespace>:<reference>).
no setter
namespace → String
The CAIP-2 namespace (e.g. eip155, solana).
final
reference → String
The CAIP-2 reference (e.g. chain ID or genesis hash).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
Returns the canonical CAIP-2 string representation.
override

Operators

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