UNPKG

@xylabs/hex

Version:

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

18 lines 883 B
import type { Brand } from '@xylabs/typeof'; import * as z from 'zod'; import { type Hex } from '../hex/index.ts'; /** A 160-bit zero address constant. */ export declare const ZERO_ADDRESS: Address; /** The character length of an address hex string (40 hex characters / 20 bytes). */ export declare const ADDRESS_LENGTH: 40; /** Regular expression matching a 20-byte (40 hex character) address string. */ export declare const AddressRegEx: RegExp; type BrandedAddress = Brand<Hex, { readonly __address: true; }>; /** Zod schema that validates and transforms a string into a branded Address type. */ export declare const AddressZod: z.ZodPipe<z.ZodString, z.ZodTransform<BrandedAddress, string>>; /** A validated 20-byte address string type, inferred from the AddressZod schema. */ export type Address = z.infer<typeof AddressZod>; export {}; //# sourceMappingURL=address.d.ts.map