Skip to content

AuthorizationTempo.hash

Computes the hash for an AuthorizationTempo.AuthorizationTempo in EIP-7702 format: keccak256('0x05' || rlp([chain_id, address, nonce])).

Imports

Named
import { AuthorizationTempo } from 'ox/tempo'

Examples

import { AuthorizationTempo } from 'ox/tempo'
 
const authorization = AuthorizationTempo.from({
  address: '0x1234567890abcdef1234567890abcdef12345678',
  chainId: 1,
  nonce: 69n,
})
 
const hash = AuthorizationTempo.hash(authorization)

Definition

function hash(
  authorization: AuthorizationTempo.AuthorizationTempo,
  options?: hash.Options,
): Hex.Hex

Source: src/tempo/AuthorizationTempo.ts

Parameters

authorization

  • Type: AuthorizationTempo.AuthorizationTempo

The AuthorizationTempo.AuthorizationTempo.

authorization.address

  • Type: abitype_Address

Address of the contract to set as code for the Authority.

authorization.chainId

  • Type: numberType

Chain ID to authorize.

authorization.nonce

  • Type: bigintType

Nonce of the Authority to authorize.

authorization.signature

  • Type: SignatureEnvelope
  • Optional

options

  • Type: hash.Options
  • Optional

options.presign

  • Type: boolean
  • Optional

Whether to hash this authorization for signing.

Return Type

The hash.

Hex.Hex