# Signature.from

Instantiates a typed [`Signature.Signature`](/api/Signature/types#signature) object from a [`Signature.Signature`](/api/Signature/types#signature), [`Signature.Legacy`](/api/Signature/types#legacy), [`Bytes.Bytes`](/api/Bytes/types#bytes), or [`Hex.Hex`](/api/Hex/types#hex).

## Imports

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

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

## Examples

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

Signature.from({
  r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
  s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
  yParity: 1
})
// @log: {
// @log:   r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
// @log:   s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
// @log:   yParity: 1
// @log: }
```

### From Serialized

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

Signature.from(
  '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db801'
)
// @log: {
// @log:   r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
// @log:   s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
// @log:   yParity: 1,
// @log: }
```

### From Legacy

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

Signature.from({
  r: '0x68a020a21f5d20c5cf6c9b4d2dccdcdd14a9f7b9c2eb19d3d3acdb2a1a9c1f50',
  s: '0x7e8d44a4a8a3e3a4c6a3c1a3c3a3c1a3c1a3c1a3c1a3c1a3c1a3c1a3c1a3c1a4',
  v: 27
})
// @log: {
// @log:   r: '0x68a020a21f5d20c5cf6c9b4d2dccdcdd14a9f7b9c2eb19d3d3acdb2a1a9c1f50',
// @log:   s: '0x7e8d44a4a8a3e3a4c6a3c1a3c3a3c1a3c1a3c1a3c1a3c1a3c1a3c1a3c1a3c1a4',
// @log:   yParity: 0
// @log: }
```

## Definition

```ts
function from<signature>(
  signature: signature | OneOf<Signature<boolean> | Rpc<boolean> | Legacy | LegacyRpc> | Hex.Hex | Bytes.Bytes,
): from.ReturnType<signature>
```

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

## Parameters

### signature

* **Type:** `signature | OneOf<Signature<boolean> | Rpc<boolean> | Legacy | LegacyRpc> | Hex.Hex | Bytes.Bytes`

The signature value to instantiate.

## Return Type

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

`from.ReturnType<signature>`
