AbiItem.getSignatureHash
Computes the signature hash for an AbiItem.AbiItem
.
Useful for computing Event Topic values.
Imports
Named
import { AbiItem } from 'ox'
Examples
import { AbiItem } from 'ox'
const hash = AbiItem.getSignatureHash('event Transfer(address indexed from, address indexed to, uint256 amount)')
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
import { AbiItem } from 'ox'
const hash = AbiItem.getSignatureHash({
name: 'Transfer',
type: 'event',
inputs: [
{ name: 'from', type: 'address', indexed: true },
{ name: 'to', type: 'address', indexed: true },
{ name: 'amount', type: 'uint256', indexed: false },
],
})
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'
Definition
function getSignatureHash(
abiItem: string | AbiItem,
): Hex.Hex
Source: src/core/AbiItem.ts
Parameters
abiItem
- Type:
string | AbiItem
The ABI Item to compute the signature hash for.
Return Type
The Hash.keccak256
hash of the ABI item's signature.
Hex.Hex