# getChain

```ts
function getChain(id?): Chain;
```

Defined in: [packages/synapse-core/src/chains.ts:268](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/packages/synapse-core/src/chains.ts#L268)

Get a chain by id

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `id?` | `number` | The chain id. Defaults to mainnet. |

## Returns

[`Chain`](/reference/filoz/synapse-core/chains/interfaces/chain/)