> **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.

# Signature.from

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

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

## Imports

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

## Examples

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

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

### From Serialized

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

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

### From Legacy

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

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>
```

## 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`](/docs/utilities/signature/types#signature).

`from.ReturnType<signature>`
