Defines type-safe Zod schemas for commerce, money, and trust signals.
// Source: https://github.com/cinderline/northcinder | License: MIT | Copyright 2026 the NorthCinder contributors
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";
/**
* Money is ALWAYS integer minor units (cents, pence, …) + an ISO-4217 code.
* Floats never represent money anywhere in the protocol.
*/
export const MoneySchema = z.object({
amount: z.int().nonnegative(),
currency: z.string().regex(/^[A-Z]{3}$/, "ISO-4217 uppercase 3-letter currency code"),
});
export type Money = z.infer<typeof MoneySchema>;
/**
* Merchant identity — who the buyer would actually be transacting with.
*
* `id` and `domain` forbid the `#` character: it is the reserved delimiter in
* `trustKey` (see trust/key.ts), so allowing it would let a hostile merchant
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key