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

# Authorization.from

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

Converts an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization object into a typed [`Authorization.Authorization`](/docs/utilities/authorization/types#authorization).

## Imports

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

## Examples

An Authorization can be instantiated from an [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.

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

const authorization = Authorization.from({
  address: '0x1234567890abcdef1234567890abcdef12345678',
  chainId: 1,
  nonce: 69n
})
```

### Attaching Signatures

A [`Signature.Signature`](/docs/utilities/signature/types#signature) can be attached with the `signature` option. The example below demonstrates signing an Authorization with [`Secp256k1.sign`](/docs/utilities/secp256k1/sign).

```ts twoslash
// @noErrors
import { Authorization, Secp256k1 } from 'viem/utils'

const authorization = Authorization.from({
  address: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  chainId: 1,
  nonce: 40n
})

const signature = Secp256k1.sign({
  payload: Authorization.getSignPayload(authorization),
  privateKey: '0x...'
})

const authorization_signed = Authorization.from(
  authorization,
  { signature }
) // [!code focus]
```

## Definition

```ts
function from<authorization, signature>(
  authorization: authorization | Authorization,
  options?: from.Options<signature>,
): from.ReturnType<authorization, signature>
```

## Parameters

### authorization

* **Type:** `authorization | Authorization`

An [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) Authorization tuple in object format.

### options

* **Type:** `from.Options<signature>`
* **Optional**

Authorization options.

#### options.signature

* **Type:** `signature | { r: 0x${string}; s: 0x${string}; yParity: number; }`
* **Optional**

The [`Signature.Signature`](/docs/utilities/signature/types#signature) to attach to the Authorization.

## Return Type

The [`Authorization.Authorization`](/docs/utilities/authorization/types#authorization).

`from.ReturnType<authorization, signature>`
