getNetwork
Get exactly one network matching the filter, throwing if zero or many match.
Import
ts
import { getNetwork } from "@0xcurvy/curvy-sdk/actions";Usage
ts
const ethereum = getNetwork({ filter: "ethereum" });Signature
ts
function getNetwork(parameters?: GetNetworkParameters): NetworkReturns
Network
The action resolves or returns the value shown in the signature.
Parameters
filter
- Type:
NetworkFilter - Required: no
Optional filter (slug, id, array, boolean testnet flag, or callback).
ts
const result = getNetwork({
filter,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
ts
const result = getNetwork({
config,
});Errors
- when no network matches or more than one network matches.
Related
- Config guide
getNetworks— Get the known networks, optionally narrowed by a filter.switchNetworkEnvironment— Switch the active network environment, recomputing the active network set.watchEnvironment— Subscribe to changes of the config's network environment.ensResolveCurvyId— Resolve a Curvy handle to an on-chain address via ENS for the active environment.