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

# Fee.fromHistoryRpc

:::info
`Fee.fromHistoryRpc` is a re-export of ox's [`Fee.fromHistoryRpc`](https://oxlib.sh/api/Fee/fromHistoryRpc). Refer to the ox documentation for the full reference.
:::

Converts a [`Fee.FeeHistoryRpc`](/docs/utilities/fee/types#feehistoryrpc) to a [`Fee.FeeHistory`](/docs/utilities/fee/types#feehistory).

## Imports

```ts
import { Fee } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Fee } from 'viem/utils'

const history = Fee.fromHistoryRpc({
  baseFeePerGas: ['0x01', '0x02'],
  gasUsedRatio: [0.5, 0.6],
  oldestBlock: '0x10',
  reward: [['0x01']]
})
// @log: { baseFeePerGas: [1n, 2n], gasUsedRatio: [0.5, 0.6], oldestBlock: 16n, reward: [[1n]] }
```

## Definition

```ts
function fromHistoryRpc(
  history: FeeHistoryRpc,
): FeeHistory
```

## Parameters

### history

* **Type:** `FeeHistoryRpc`

The RPC fee history to convert.

## Return Type

An instantiated [`Fee.FeeHistory`](/docs/utilities/fee/types#feehistory).

`FeeHistory`
