UNPKG

permissionless

Version:

A utility library for working with ERC-4337

14 lines (12 loc) 307 B
import { type Address, type Hex, getAddress } from "viem" export function getAddressFromInitCodeOrPaymasterAndData( data: Hex ): Address | undefined { if (!data) { return undefined } if (data.length >= 42) { return getAddress(data.slice(0, 42)) } return undefined }