Skip to content

recoverTransactionAddress

Recovers the original signing address from a transaction & signature.

Usage

example.ts
import { recoverTransactionAddress } from 'viem'
import { walletClient } from './client'
 
const request = await walletClient.prepareTransactionRequest({
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: 1000000000000000000n
})
 
const rawTransaction = await walletClient.signTransaction(request)
 
const address = await recoverTransactionAddress({ 
  transaction: parseTransaction(rawTransaction),
})

Returns

Address

The signing address.

Parameters

transaction

  • Type: TransactionSerializable

The transaction.

signature (optional)

  • Type: Signature | Hex | ByteArray
  • Default: Signature inferred on transaction

The signature.