Skip to content

Instantly share code, notes, and snippets.

@gregfromstl
Created March 8, 2025 00:10
Show Gist options
  • Select an option

  • Save gregfromstl/d7098325d8c1ab72ad5e4c0ad1cc9419 to your computer and use it in GitHub Desktop.

Select an option

Save gregfromstl/d7098325d8c1ab72ad5e4c0ad1cc9419 to your computer and use it in GitHub Desktop.
Checksum Address Hono
import { z } from "@hono/zod-openapi";
import { Address as ox__Address } from "ox";
export const AddressSchema = z
.string()
.refine((address) => ox__Address.validate(address), {
message: "Must be a valid Ethereum address",
})
.transform((address) => ox__Address.checksum(address));
export type Address = z.infer<typeof AddressSchema>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment