# normalize_network

> Normalize network identifier to CAIP-2 format.

```python
from x402_algorand import normalize_network
```

```python
def normalize_network(network: str) -> str
```

Normalize network identifier to CAIP-2 format.

## Parameters

- `network` (`str`, required):
Network identifier (V1 name, legacy long CAIP-2, or short CAIP-2).

## Returns

- `returns` (`str`):
CAIP-2 network identifier.

## Raises

- `NetworkError`: If network is not supported or invalid format (subclass of `ValueError`).

## Examples

```python
from x402_algorand import normalize_network

print(normalize_network("algorand-testnet"))
# algorand:SGO1GKSzyE7IEPItTxCByw9x8FmnrCDe
print(normalize_network("algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8="))  # legacy id
# algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73k
```

Source: [x402_algorand/utils.py](https://github.com/x402-avm/x402-algorand/blob/main/x402_algorand/utils.py#L153)

Source: https://x402-avm.github.io/reference/python/x402-algorand/normalize-network
