Skip to content

Authorization.hash

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

Imports

Named
import { Authorization } from 'ox'

Examples

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

Definition

function hash(
  authorization: Authorization,
): Hex.Hex

Source: src/core/Authorization.ts

Parameters

authorization

  • Type: Authorization

The Authorization.Authorization.

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.

Return Type

The hash.

Hex.Hex