Skip to main content
The @ankarachain/sdk ships a NETWORKS map and a getNetwork() helper that give you the full configuration for every supported chain — chain ID, public RPC URL, block explorer link, and native currency details — without any runtime fetching. You can use them directly when building custom integrations or to validate that a given network identifier is supported before constructing a config.

getNetwork()

Returns the NetworkConfig object for a given network key. Throws an Error if the key is not in the NETWORKS map.
Example:

NETWORKS constant

The full map of every built-in network configuration, keyed by SupportedNetwork.

Supported networks table

Stellar networks do not have a numeric chain ID. They are identified by their networkPassphrase. Stellar Mainnet has no official free public Soroban RPC — you must supply your own via rpcUrl in your StellarAnkaraChainConfig when deploying to mainnet.

Overriding the RPC URL

You can pass a custom rpcUrl in your config to point the SDK at a private or premium RPC node — Alchemy, Infura, QuickNode, etc. The SDK will use your URL instead of the public default.
This is strongly recommended in production. Public RPC endpoints are rate-limited and unsuitable for high-volume use.

EVMNetworkConfig and StellarNetworkConfig shapes

Both shapes share name, rpcUrl, explorerUrl, and nativeCurrency, but differ in their chain-identifying fields:
Discriminate between them using the chainFamily field: