Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
import { getAddress, isAddress } from "npm:viem";
const infoMessage = "Try passing an EVM address as a path param\ne.g., /0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359";
export default async (request: Request): Promise<Response> => {
const url = new URL(request.url);
const address = url.pathname.split("/").at(-1);
const checksummed = isAddress(address) ? getAddress(address) : infoMessage;
return new Response(checksummed);
};
git-checksum.web.val.run
April 23, 2024