# Signature.fromLegacy

Converts a [`Signature.Legacy`](/api/Signature/types#legacy) into a [`Signature.Signature`](/api/Signature/types#signature).

## Imports

:::code-group
```ts [Named]
import { Signature } from 'ox'
```

```ts [Entrypoint]
import * as Signature from 'ox/Signature'
```
:::

## Examples

```ts twoslash
import { Signature } from 'ox'

const legacy = Signature.fromLegacy({
  r: '0x01',
  s: '0x02',
  v: 28
})
// @log: { r: '0x01', s: '0x02', yParity: 1 }
```

## Definition

```ts
function fromLegacy(
  signature: Legacy | LegacyRpc,
): Signature
```

**Source:** [src/core/Signature.ts](https://github.com/wevm/ox/blob/main/src/core/Signature.ts#L1010)

## Parameters

### signature

* **Type:** `Legacy | LegacyRpc`

The [`Signature.Legacy`](/api/Signature/types#legacy) to convert.

#### signature.r

* **Type:** `0x${string}`

#### signature.s

* **Type:** `0x${string}`

#### signature.v

* **Type:** `numberType`

## Return Type

The converted [`Signature.Signature`](/api/Signature/types#signature).

`Signature`
