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 serializedTransaction = await walletClient.signTransaction(request)
const address = await recoverTransactionAddress({
serializedTransaction,
})
Returns
The signing address.
Parameters
serializedTransaction
- Type:
TransactionSerialized
The RLP serialized transaction.
signature (optional)
- Type:
Signature | Hex | ByteArray
- Default: Signature inferred on
serializedTransaction
(if exists)
The signature.