Skip to content

ZoneRpcAuthentication.getSignPayload

Computes the sign payload for a Zone RPC authentication token.

When userAddress is provided, the payload is wrapped as keccak256(0x04 || authHash || userAddress) to match V2 keychain signing.

Imports

Named
import { ZoneRpcAuthentication } from 'ox/tempo'

Examples

import { ZoneRpcAuthentication } from 'ox/tempo'
 
const authentication = ZoneRpcAuthentication.from({
  chainId: 4217000026,
  expiresAt: 1711235160,
  issuedAt: 1711234560,
  zoneId: 26,
})
 
const payload = ZoneRpcAuthentication.getSignPayload(authentication)

Definition

function getSignPayload(
  authentication: PartialBy<ZoneRpcAuthentication, 'version'>,
  options?: getSignPayload.Options,
): Hex.Hex

Source: src/tempo/ZoneRpcAuthentication.ts

Parameters

authentication

  • Type: PartialBy<ZoneRpcAuthentication, 'version'>

The Zone RPC authentication token.

options

  • Type: getSignPayload.Options
  • Optional

Options.

options.userAddress

  • Type: TempoAddress.Address | undefined
  • Optional

Root account address for keychain access-key signing.

When provided, computes keccak256(0x04 || authHash || userAddress) instead of the raw authHash.

Return Type

The sign payload.

Hex.Hex