# ZoneRpcAuthentication.from

Instantiates a typed Zone RPC authentication token.

## Imports

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

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

## Examples

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

const authentication = ZoneRpcAuthentication.from({
  chainId: 4217000026,
  expiresAt: 1711235160,
  issuedAt: 1711234560,
  zoneId: 26
})
```

### Attaching Signatures

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

const authentication = ZoneRpcAuthentication.from({
  chainId: 4217000026,
  expiresAt: 1711235160,
  issuedAt: 1711234560,
  zoneId: 26
})

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

const authentication_signed = ZoneRpcAuthentication.from(
  authentication,
  {
    signature
  }
)
```

## Definition

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

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

## Parameters

### authentication

* **Type:** `authentication | ZoneRpcAuthentication`

Zone RPC authentication token fields.

### options

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

Zone RPC authentication options.

#### options.signature

* **Type:** `SignatureEnvelope | signature`
* **Optional**

The signature to attach to the authentication token.

## Return Type

The instantiated Zone RPC authentication token.

`from.ReturnType<authentication, signature>`
