> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# getAddresses

Returns all protocol contract addresses for a supported chain. Throws if the chain is not supported.

## Import

```ts twoslash
import { getAddresses } from '@railnetorg/railnet-sdk'
```

## Usage

```ts twoslash
import { mainnet } from 'viem/chains'
import { getAddresses } from '@railnetorg/railnet-sdk'

const { conduitFactory, usdc, aaveV3VehicleFactory } = getAddresses(mainnet.id)
```

### With buildSpawnConduitCall

```ts
import { simulateContract, writeContract } from 'viem/actions'
import { mainnet } from 'viem/chains'
import { buildSpawnConduitCall, getAddresses, randomSalt } from '@railnetorg/railnet-sdk'

const { conduitFactory } = getAddresses(mainnet.id)

const { request } = await simulateContract(client, {
  ...buildSpawnConduitCall({
    factory: conduitFactory,
    name: 'My Conduit',
    symbol: 'COND',
    vehicle: '0x...',
    initialExpectedSupply: 1000000n,
    transferEnabled: true,
    accessControl: '0x...',
    feeManager: '0x...',
    accountList: '0x...',
    ownerRegistry: '0x...',
    querySalt: randomSalt(),
    deploymentSalt: randomSalt(),
  }),
  account: '0x...',
})

const hash = await writeContract(client, request)
```

## Returns

`ChainAddresses`

See [`ChainAddresses`](/types/ChainAddresses).

## Parameters

### chainId

* **Type:** `number`

## Supported Chains

| Chain | Chain ID |
| --- | --- |
| Ethereum | `1` |

All addresses are defined in [`src/contracts/addresses.ts`](https://github.com/railnetorg/railnet-sdk/blob/main/src/contracts/addresses.ts).

## Error Handling

```ts twoslash
import { getAddresses, isSupportedChain } from '@railnetorg/railnet-sdk'

const chainId = 42161

if (isSupportedChain(chainId)) {
  const addresses = getAddresses(chainId)
}
```

## Production only

This entry point holds production deployments. Base has none yet, so `getAddresses(8453)` throws
here. See [Staging deployments](/contracts/staging).
