export type AmountFailure = { kind: "invalid_amount"; input: string } | { kind: "too_large" };export class AmountError extends Error { declare readonly kind: AmountFailure["kind"]; declare readonly input?: string; constructor(failure: AmountFailure) { super(failure.kind); Object.assign(this, failure); }}/** Returns integer cents. Throws AmountError on malformed or oversized input. */export function parseAmount(text: string): number { // TODO}