# AuthorizationTempo

Utilities for Tempo-flavoured EIP-7702 authorizations.

Tempo extends EIP-7702 to support more signature types (secp256k1, P256, and WebAuthn),
enabling passkey-based account delegation. Authorizations delegate an account to a specified
implementation contract.

[Tempo Authorization Specification](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#tempo-authorization-list)

## Examples

```ts twoslash
import { Secp256k1 } from 'ox'
import { AuthorizationTempo } from 'ox/tempo'

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

const payload =
  AuthorizationTempo.getSignPayload(authorization)

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

const authorization_signed = AuthorizationTempo.from(
  authorization,
  { signature }
)
```

## Functions

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`AuthorizationTempo.from`](/tempo/reference/AuthorizationTempo/from) | Converts an EIP-7702 Authorization object into a typed [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.fromRpc`](/tempo/reference/AuthorizationTempo/fromRpc) | Converts an [`AuthorizationTempo.Rpc`](/tempo/reference/AuthorizationTempo/types#rpc) to an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.fromRpcList`](/tempo/reference/AuthorizationTempo/fromRpcList) | Converts an [`AuthorizationTempo.ListRpc`](/tempo/reference/AuthorizationTempo/types#listrpc) to an [`AuthorizationTempo.List`](/tempo/reference/AuthorizationTempo/types#list). |
| [`AuthorizationTempo.fromTuple`](/tempo/reference/AuthorizationTempo/fromTuple) | Converts an [`AuthorizationTempo.Tuple`](/tempo/reference/AuthorizationTempo/types#tuple) to an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.fromTupleList`](/tempo/reference/AuthorizationTempo/fromTupleList) | Converts an [`AuthorizationTempo.TupleList`](/tempo/reference/AuthorizationTempo/types#tuplelist) to an [`AuthorizationTempo.List`](/tempo/reference/AuthorizationTempo/types#list). |
| [`AuthorizationTempo.getSignPayload`](/tempo/reference/AuthorizationTempo/getSignPayload) | Computes the sign payload for an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo) in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`. |
| [`AuthorizationTempo.hash`](/tempo/reference/AuthorizationTempo/hash) | Computes the hash for an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo) in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`. |
| [`AuthorizationTempo.toRpc`](/tempo/reference/AuthorizationTempo/toRpc) | Converts an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo) to an [`AuthorizationTempo.Rpc`](/tempo/reference/AuthorizationTempo/types#rpc). |
| [`AuthorizationTempo.toRpcList`](/tempo/reference/AuthorizationTempo/toRpcList) | Converts an [`AuthorizationTempo.List`](/tempo/reference/AuthorizationTempo/types#list) to an [`AuthorizationTempo.ListRpc`](/tempo/reference/AuthorizationTempo/types#listrpc). |
| [`AuthorizationTempo.toTuple`](/tempo/reference/AuthorizationTempo/toTuple) | Converts an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo) to an [`AuthorizationTempo.Tuple`](/tempo/reference/AuthorizationTempo/types#tuple). |
| [`AuthorizationTempo.toTupleList`](/tempo/reference/AuthorizationTempo/toTupleList) | Converts an [`AuthorizationTempo.List`](/tempo/reference/AuthorizationTempo/types#list) to an [`AuthorizationTempo.TupleList`](/tempo/reference/AuthorizationTempo/types#tuplelist). |

## Types

| Name                | Description                         |
| ------------------- | ----------------------------------- |
| [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempoauthorizationtempo) | Root type for a Tempo Authorization. |
| [`AuthorizationTempo.List`](/tempo/reference/AuthorizationTempo/types#authorizationtempolist) | List of [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.ListRpc`](/tempo/reference/AuthorizationTempo/types#authorizationtempolistrpc) | RPC representation of a list of AA Authorizations. |
| [`AuthorizationTempo.ListSigned`](/tempo/reference/AuthorizationTempo/types#authorizationtempolistsigned) | Signed representation of a list of AA Authorizations. |
| [`AuthorizationTempo.Rpc`](/tempo/reference/AuthorizationTempo/types#authorizationtemporpc) | RPC representation of an [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.Signed`](/tempo/reference/AuthorizationTempo/types#authorizationtemposigned) | Signed representation of an AA Authorization. |
| [`AuthorizationTempo.Tuple`](/tempo/reference/AuthorizationTempo/types#authorizationtempotuple) | Tuple representation of an AA Authorization. |
| [`AuthorizationTempo.TupleList`](/tempo/reference/AuthorizationTempo/types#authorizationtempotuplelist) | Tuple representation of a list of [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.TupleListSigned`](/tempo/reference/AuthorizationTempo/types#authorizationtempotuplelistsigned) | Tuple representation of a list of signed [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
| [`AuthorizationTempo.TupleSigned`](/tempo/reference/AuthorizationTempo/types#authorizationtempotuplesigned) | Tuple representation of a signed [`AuthorizationTempo.AuthorizationTempo`](/tempo/reference/AuthorizationTempo/types#authorizationtempo). |
