# 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/aaa98045b003ec23f4318ba9a3032a434e5a20c9/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/)