# getChain

> **getChain**(`id?`): [`FilecoinChain`](/reference/filoz/synapse-core/chains/interfaces/filecoinchain/)

Defined in: [packages/synapse-core/src/chains.ts:335](https://github.com/FilOzone/synapse-sdk/blob/ccd1546626324814f05a7401da066d4361eb8bda/packages/synapse-core/src/chains.ts#L335)

Get a chain by id

## Parameters

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

## Returns

[`FilecoinChain`](/reference/filoz/synapse-core/chains/interfaces/filecoinchain/)

## Throws

Errors [getChain.ErrorType](/reference/filoz/synapse-core/chains/namespaces/getchain/type-aliases/errortype/)