UNPKG

permissionless

Version:

A utility library for working with ERC-4337

9 lines (6 loc) 271 B
import { toHex } from "viem" export function encodeNonce(args: { key: bigint; sequence: bigint }): bigint { const key = BigInt(toHex(args.key, { size: 24 })) const sequence = BigInt(toHex(args.sequence, { size: 8 })) return (key << BigInt(64)) + sequence }