> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# TxEnvelopeEip2930.hash

:::info
`TxEnvelopeEip2930.hash` is a re-export of ox's [`TxEnvelopeEip2930.hash`](https://oxlib.sh/api/TxEnvelopeEip2930/hash). Refer to the ox documentation for the full reference.
:::

Hashes a [`TxEnvelopeEip2930.TxEnvelopeEip2930`](/docs/utilities/txenvelopeeip2930/types#txenvelopeeip2930). This is the "transaction hash".

## Imports

```ts
import { TxEnvelopeEip2930 } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Secp256k1, TxEnvelopeEip2930 } from 'viem/utils'

const envelope = TxEnvelopeEip2930.from({
  chainId: 1,
  nonce: 0n,
  gasPrice: 1000000000n,
  gas: 21000n,
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: 1000000000000000000n
})

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

const envelope_signed = TxEnvelopeEip2930.from(envelope, {
  signature
})

const hash = TxEnvelopeEip2930.hash(envelope_signed) // [!code focus]
```

## Definition

```ts
function hash<presign>(
  envelope: TxEnvelopeEip2930<presign extends true ? false : true>,
  options?: hash.Options<presign>,
): hash.ReturnType
```

## Parameters

### envelope

* **Type:** `TxEnvelopeEip2930<presign extends true ? false : true>`

The EIP-2930 Transaction Envelope to hash.

#### envelope.accessList

* **Type:** `readonly { address: abitype_Address; storageKeys: readonly 0x${string}[]; }[]`
* **Optional**

EIP-2930 Access List.

#### envelope.chainId

* **Type:** `numberType`

EIP-155 Chain ID.

#### envelope.data

* **Type:** `0x${string}`
* **Optional**

Contract code or a hashed method call with encoded args

#### envelope.from

* **Type:** `Address.Address | undefined`
* **Optional**

Sender of the transaction. RPC-only metadata; not part of the
serialized envelope. Carried here for parity with
[`TransactionRequest.TransactionRequest`](/docs/utilities/transactionrequest/types#transactionrequest) and
[`Transaction.Transaction`](/docs/utilities/transaction/types#transaction).

#### envelope.gas

* **Type:** `bigintType`
* **Optional**

Gas provided for transaction execution

#### envelope.gasPrice

* **Type:** `bigintType`
* **Optional**

Base fee per gas.

#### envelope.input

* **Type:** `0x${string}`
* **Optional**

#### envelope.nonce

* **Type:** `bigintType`
* **Optional**

Unique number identifying this transaction

#### envelope.r

* **Type:** `0x${string}`

#### envelope.s

* **Type:** `0x${string}`

#### envelope.to

* **Type:** `Address.Address | null | undefined`
* **Optional**

Transaction recipient

#### envelope.type

* **Type:** `type`

Transaction type

#### envelope.v

* **Type:** `numberType`
* **Optional**

#### envelope.value

* **Type:** `bigintType`
* **Optional**

Value in wei sent with this transaction

#### envelope.yParity

* **Type:** `numberType`
* **Optional**

ECDSA signature yParity.

### options

* **Type:** `hash.Options<presign>`
* **Optional**

Options.

#### options.presign

* **Type:** `boolean | presign`
* **Optional**

Whether to hash this transaction for signing.

## Return Type

The hash of the transaction envelope.

`hash.ReturnType`
