# KeyAuthorization.fromRpc

Converts an [`AuthorizationTempo.Rpc`](/tempo/reference/AuthorizationTempo/types#rpc) to an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo).

## Imports

:::code-group
```ts [Named]
import { KeyAuthorization } from 'ox/tempo'
```

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

## Examples

```ts twoslash
import { KeyAuthorization } from 'ox/tempo'

const keyAuthorization = KeyAuthorization.fromRpc({
  chainId: '0x1079',
  expiry: '0x174876e800',
  keyId: '0xbe95c3f554e9fc85ec51be69a3d807a0d55bcf2c',
  keyType: 'secp256k1',
  limits: [
    {
      token: '0x20c0000000000000000000000000000000000001',
      limit: '0xf4240'
    }
  ],
  signature: {
    type: 'secp256k1',
    r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
    s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
    yParity: '0x0'
  }
})
```

## Definition

```ts
function fromRpc(
  authorization: Rpc,
): Signed
```

**Source:** [src/tempo/KeyAuthorization.ts](https://github.com/wevm/ox/blob/main/src/tempo/KeyAuthorization.ts#L1190)

## Parameters

### authorization

* **Type:** `Rpc`

The RPC-formatted Key Authorization.

#### authorization.account

* **Type:** `Address.Address | null | undefined`
* **Optional**

Optional account address binding (TIP-1049).

#### authorization.allowedCalls

* **Type:** `readonly RpcCallScope[]`
* **Optional**

Allowed call scopes (node field: `allowedCalls`).

#### authorization.chainId

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

Chain ID (hex quantity).

#### authorization.expiry

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

Expiry timestamp (hex quantity or null).

#### authorization.isAdmin

* **Type:** `boolean`
* **Optional**

Whether this authorization provisions an admin access key (TIP-1049).

#### authorization.keyId

* **Type:** `abitype_Address`

Key identifier.

#### authorization.keyType

* **Type:** `"secp256k1" | "p256" | "webAuthn"`

Key type.

#### authorization.limits

* **Type:** `readonly RpcTokenLimit[]`
* **Optional**

Token spending limits.

#### authorization.signature

* **Type:** `SignatureEnvelopeRpc`

Signature envelope.

#### authorization.witness

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

Optional 32-byte witness (hex).

## Return Type

A signed [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo).

`Signed`
