Skip to main content

Overview

Function.GetSelector creates a selector function using a custom keccak256String. Use this for alternative hashing backends (native/WASM/custom).

Quick Start

import { Abi } from '@tevm/voltaire/Abi';

const getSelector = Abi.Function.GetSelector({
  keccak256String: (value) => myKeccak256String(value)
});

const transfer = {
  type: 'function',
  name: 'transfer',
  inputs: [
    { type: 'address', name: 'to' },
    { type: 'uint256', name: 'amount' }
  ],
  outputs: [{ type: 'bool' }]
} as const;

const selector = getSelector(transfer);

See Also