# asChain

> **asChain**(`chain`): [`FilecoinChain`](/reference/filoz/synapse-core/chains/interfaces/filecoinchain/)

Defined in: [packages/synapse-core/src/chains.ts:358](https://github.com/FilOzone/synapse-sdk/blob/d2725be576fc57fac19e7c64cd8e004e0cec85d3/packages/synapse-core/src/chains.ts#L358)

Convert a viem chain to a filecoin chain.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `chain` | `Chain` | The viem chain. |

## Returns

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

The filecoin chain.

## Throws

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