@peac/schema 0.12.3 → 0.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -526,6 +526,10 @@ function isValidExtensionKey(key) {
526
526
  }
527
527
  var COMMERCE_EXTENSION_KEY = "org.peacprotocol/commerce";
528
528
  var AMOUNT_MINOR_PATTERN = /^-?[0-9]+$/;
529
+ var AmountMinorStringSchema = zod.z.string().min(1).max(EXTENSION_LIMITS.maxAmountMinorLength).regex(
530
+ AMOUNT_MINOR_PATTERN,
531
+ 'amount_minor must be a base-10 integer string (e.g., "1000", "-50")'
532
+ );
529
533
  var CommerceExtensionSchema = zod.z.object({
530
534
  /** Payment rail identifier (e.g., 'stripe', 'x402', 'lightning') */
531
535
  payment_rail: zod.z.string().min(1).max(EXTENSION_LIMITS.maxPaymentRailLength),
@@ -534,10 +538,7 @@ var CommerceExtensionSchema = zod.z.object({
534
538
  * Base-10 integer: optional leading minus, one or more digits.
535
539
  * Decimals and empty strings are rejected.
536
540
  */
537
- amount_minor: zod.z.string().min(1).max(EXTENSION_LIMITS.maxAmountMinorLength).regex(
538
- AMOUNT_MINOR_PATTERN,
539
- 'amount_minor must be a base-10 integer string (e.g., "1000", "-50")'
540
- ),
541
+ amount_minor: AmountMinorStringSchema,
541
542
  /** ISO 4217 currency code or asset identifier */
542
543
  currency: zod.z.string().min(1).max(EXTENSION_LIMITS.maxCurrencyLength),
543
544
  /** Caller-assigned payment reference */