Skip to content

ZoneRpcAuthentication.hash

Computes the raw authorization hash for a Zone RPC authentication token.

The hash is keccak256(magicBytes || fields).

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 hash = ZoneRpcAuthentication.hash(authentication)

Definition

function hash(
  authentication: PartialBy<ZoneRpcAuthentication, 'version'>,
): Hex.Hex

Source: src/tempo/ZoneRpcAuthentication.ts

Parameters

authentication

  • Type: PartialBy<ZoneRpcAuthentication, 'version'>

The Zone RPC authentication token.

Return Type

The authorization hash.

Hex.Hex