@strimz/shared-types 0.6.0 → 0.8.0

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.
Files changed (85) hide show
  1. package/README.md +7 -4
  2. package/dist/agents.cjs.map +1 -1
  3. package/dist/agents.d.cts +7 -5
  4. package/dist/agents.d.ts +7 -5
  5. package/dist/agents.js.map +1 -1
  6. package/dist/analytics.cjs +568 -0
  7. package/dist/analytics.cjs.map +1 -0
  8. package/dist/analytics.d.cts +1719 -0
  9. package/dist/analytics.d.ts +1719 -0
  10. package/dist/analytics.js +540 -0
  11. package/dist/analytics.js.map +1 -0
  12. package/dist/api-keys.cjs.map +1 -1
  13. package/dist/api-keys.d.cts +19 -17
  14. package/dist/api-keys.d.ts +19 -17
  15. package/dist/api-keys.js.map +1 -1
  16. package/dist/common.cjs.map +1 -1
  17. package/dist/common.d.cts +3 -2
  18. package/dist/common.d.ts +3 -2
  19. package/dist/common.js.map +1 -1
  20. package/dist/compliance.cjs.map +1 -1
  21. package/dist/compliance.d.cts +8 -8
  22. package/dist/compliance.d.ts +8 -8
  23. package/dist/compliance.js.map +1 -1
  24. package/dist/customers.cjs.map +1 -1
  25. package/dist/customers.d.cts +10 -9
  26. package/dist/customers.d.ts +10 -9
  27. package/dist/customers.js.map +1 -1
  28. package/dist/events.cjs.map +1 -1
  29. package/dist/events.d.cts +1936 -1936
  30. package/dist/events.d.ts +1936 -1936
  31. package/dist/events.js.map +1 -1
  32. package/dist/index.cjs +216 -0
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +25 -22
  35. package/dist/index.d.ts +25 -22
  36. package/dist/index.js +190 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/invoices.cjs.map +1 -1
  39. package/dist/invoices.d.cts +19 -18
  40. package/dist/invoices.d.ts +19 -18
  41. package/dist/invoices.js.map +1 -1
  42. package/dist/merchants.cjs.map +1 -1
  43. package/dist/merchants.d.cts +42 -36
  44. package/dist/merchants.d.ts +42 -36
  45. package/dist/merchants.js.map +1 -1
  46. package/dist/payment-sessions.cjs.map +1 -1
  47. package/dist/payment-sessions.d.cts +24 -22
  48. package/dist/payment-sessions.d.ts +24 -22
  49. package/dist/payment-sessions.js.map +1 -1
  50. package/dist/refunds.cjs.map +1 -1
  51. package/dist/refunds.d.cts +55 -53
  52. package/dist/refunds.d.ts +55 -53
  53. package/dist/refunds.js.map +1 -1
  54. package/dist/storefronts.cjs.map +1 -1
  55. package/dist/storefronts.d.cts +31 -28
  56. package/dist/storefronts.d.ts +31 -28
  57. package/dist/storefronts.js.map +1 -1
  58. package/dist/subscriptions.cjs.map +1 -1
  59. package/dist/subscriptions.d.cts +49 -46
  60. package/dist/subscriptions.d.ts +49 -46
  61. package/dist/subscriptions.js.map +1 -1
  62. package/dist/transactions.cjs.map +1 -1
  63. package/dist/transactions.d.cts +14 -14
  64. package/dist/transactions.d.ts +14 -14
  65. package/dist/transactions.js.map +1 -1
  66. package/dist/webhooks.cjs.map +1 -1
  67. package/dist/webhooks.d.cts +33 -31
  68. package/dist/webhooks.d.ts +33 -31
  69. package/dist/webhooks.js.map +1 -1
  70. package/package.json +6 -1
  71. package/src/agents.ts +4 -2
  72. package/src/analytics.ts +275 -0
  73. package/src/api-keys.ts +4 -2
  74. package/src/common.ts +2 -1
  75. package/src/contact.ts +2 -1
  76. package/src/customers.ts +2 -1
  77. package/src/index.ts +1 -0
  78. package/src/invoices.ts +2 -1
  79. package/src/merchants.ts +12 -6
  80. package/src/notifications.ts +2 -1
  81. package/src/payment-sessions.ts +4 -2
  82. package/src/refunds.ts +4 -2
  83. package/src/storefronts.ts +6 -3
  84. package/src/subscriptions.ts +6 -3
  85. package/src/webhooks.ts +4 -2
@@ -32,14 +32,14 @@ declare const merchantSchema: z.ZodObject<{
32
32
  updatedAt: z.ZodString;
33
33
  }, "strip", z.ZodTypeAny, {
34
34
  status: "active" | "suspended" | "closed";
35
+ businessName: string;
36
+ email: string;
35
37
  id: string;
36
- walletAddress: string | null;
37
38
  createdAt: string;
38
- email: string;
39
- metadata: Record<string, string | number | boolean | null>;
40
39
  updatedAt: string;
40
+ metadata: Record<string, string | number | boolean | null>;
41
+ walletAddress: string | null;
41
42
  onchainMerchantId: number | null;
42
- businessName: string;
43
43
  tier: "free" | "growth" | "business" | "enterprise";
44
44
  payoutAddress: string | null;
45
45
  onboardingCompleted: boolean;
@@ -50,13 +50,13 @@ declare const merchantSchema: z.ZodObject<{
50
50
  whitelabelEnabled: boolean;
51
51
  }, {
52
52
  status: "active" | "suspended" | "closed";
53
+ businessName: string;
54
+ email: string;
53
55
  id: string;
54
- walletAddress: string | null;
55
56
  createdAt: string;
56
- email: string;
57
57
  updatedAt: string;
58
+ walletAddress: string | null;
58
59
  onchainMerchantId: number | null;
59
- businessName: string;
60
60
  tier: "free" | "growth" | "business" | "enterprise";
61
61
  payoutAddress: string | null;
62
62
  onboardingCompleted: boolean;
@@ -75,19 +75,20 @@ declare const createMerchantInputSchema: z.ZodObject<{
75
75
  countryCode: z.ZodOptional<z.ZodString>;
76
76
  websiteUrl: z.ZodOptional<z.ZodString>;
77
77
  }, "strip", z.ZodTypeAny, {
78
- email: string;
79
78
  businessName: string;
79
+ email: string;
80
80
  password: string;
81
81
  countryCode?: string | undefined;
82
82
  websiteUrl?: string | undefined;
83
83
  }, {
84
- email: string;
85
84
  businessName: string;
85
+ email: string;
86
86
  password: string;
87
87
  countryCode?: string | undefined;
88
88
  websiteUrl?: string | undefined;
89
89
  }>;
90
- type CreateMerchantInput = z.infer<typeof createMerchantInputSchema>;
90
+ type CreateMerchantInput = z.input<typeof createMerchantInputSchema>;
91
+ type CreateMerchantParsed = z.output<typeof createMerchantInputSchema>;
91
92
  /**
92
93
  * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.
93
94
  * Both default to true. Welcome, refunds, and admin broadcasts always send.
@@ -125,8 +126,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
125
126
  subscriptionCharged?: boolean | undefined;
126
127
  }>>;
127
128
  }, "strip", z.ZodTypeAny, {
128
- metadata?: Record<string, string | number | boolean | null> | undefined;
129
129
  businessName?: string | undefined;
130
+ metadata?: Record<string, string | number | boolean | null> | undefined;
130
131
  payoutAddress?: string | undefined;
131
132
  defaultCurrency?: "USDC" | "EURC" | undefined;
132
133
  countryCode?: string | null | undefined;
@@ -137,8 +138,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
137
138
  subscriptionCharged?: boolean | undefined;
138
139
  } | undefined;
139
140
  }, {
140
- metadata?: Record<string, string | number | boolean | null> | undefined;
141
141
  businessName?: string | undefined;
142
+ metadata?: Record<string, string | number | boolean | null> | undefined;
142
143
  payoutAddress?: string | undefined;
143
144
  defaultCurrency?: "USDC" | "EURC" | undefined;
144
145
  countryCode?: string | null | undefined;
@@ -149,7 +150,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
149
150
  subscriptionCharged?: boolean | undefined;
150
151
  } | undefined;
151
152
  }>;
152
- type UpdateMerchantInput = z.infer<typeof updateMerchantInputSchema>;
153
+ type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>;
154
+ type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>;
153
155
  declare const changeTierInputSchema: z.ZodObject<{
154
156
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
155
157
  }, "strip", z.ZodTypeAny, {
@@ -157,7 +159,8 @@ declare const changeTierInputSchema: z.ZodObject<{
157
159
  }, {
158
160
  tier: "free" | "growth" | "business" | "enterprise";
159
161
  }>;
160
- type ChangeTierInput = z.infer<typeof changeTierInputSchema>;
162
+ type ChangeTierInput = z.input<typeof changeTierInputSchema>;
163
+ type ChangeTierParsed = z.output<typeof changeTierInputSchema>;
161
164
  /**
162
165
  * Self-attested onboarding form the dashboard collects after a
163
166
  * merchant first logs in via Privy. On success the API stamps
@@ -193,21 +196,22 @@ declare const onboardMerchantInputSchema: z.ZodObject<{
193
196
  logoUrl?: string | undefined;
194
197
  phone?: string | undefined;
195
198
  }>;
196
- type OnboardMerchantInput = z.infer<typeof onboardMerchantInputSchema>;
199
+ type OnboardMerchantInput = z.input<typeof onboardMerchantInputSchema>;
200
+ type OnboardMerchantParsed = z.output<typeof onboardMerchantInputSchema>;
197
201
  declare const merchantPublicBrandSchema: z.ZodObject<{
198
202
  id: z.ZodString;
199
203
  businessName: z.ZodString;
200
204
  logoUrl: z.ZodNullable<z.ZodString>;
201
205
  walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
202
206
  }, "strip", z.ZodTypeAny, {
207
+ businessName: string;
203
208
  id: string;
204
209
  walletAddress: string | null;
205
- businessName: string;
206
210
  logoUrl: string | null;
207
211
  }, {
212
+ businessName: string;
208
213
  id: string;
209
214
  walletAddress: string | null;
210
- businessName: string;
211
215
  logoUrl: string | null;
212
216
  }>;
213
217
  type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
@@ -284,16 +288,16 @@ declare const merchantMemberSchema: z.ZodObject<{
284
288
  invitedAt: z.ZodString;
285
289
  acceptedAt: z.ZodNullable<z.ZodString>;
286
290
  }, "strip", z.ZodTypeAny, {
287
- id: string;
288
291
  merchantId: string;
289
292
  email: string;
293
+ id: string;
290
294
  role: "owner" | "admin" | "developer" | "read_only";
291
295
  invitedAt: string;
292
296
  acceptedAt: string | null;
293
297
  }, {
294
- id: string;
295
298
  merchantId: string;
296
299
  email: string;
300
+ id: string;
297
301
  role: "owner" | "admin" | "developer" | "read_only";
298
302
  invitedAt: string;
299
303
  acceptedAt: string | null;
@@ -309,7 +313,8 @@ declare const inviteMemberInputSchema: z.ZodObject<{
309
313
  email: string;
310
314
  role: "owner" | "admin" | "developer" | "read_only";
311
315
  }>;
312
- type InviteMemberInput = z.infer<typeof inviteMemberInputSchema>;
316
+ type InviteMemberInput = z.input<typeof inviteMemberInputSchema>;
317
+ type InviteMemberParsed = z.output<typeof inviteMemberInputSchema>;
313
318
  declare const loginInputSchema: z.ZodObject<{
314
319
  email: z.ZodString;
315
320
  password: z.ZodString;
@@ -320,7 +325,8 @@ declare const loginInputSchema: z.ZodObject<{
320
325
  email: string;
321
326
  password: string;
322
327
  }>;
323
- type LoginInput = z.infer<typeof loginInputSchema>;
328
+ type LoginInput = z.input<typeof loginInputSchema>;
329
+ type LoginParsed = z.output<typeof loginInputSchema>;
324
330
  declare const loginOutputSchema: z.ZodObject<{
325
331
  accessToken: z.ZodString;
326
332
  refreshToken: z.ZodString;
@@ -344,14 +350,14 @@ declare const loginOutputSchema: z.ZodObject<{
344
350
  updatedAt: z.ZodString;
345
351
  }, "strip", z.ZodTypeAny, {
346
352
  status: "active" | "suspended" | "closed";
353
+ businessName: string;
354
+ email: string;
347
355
  id: string;
348
- walletAddress: string | null;
349
356
  createdAt: string;
350
- email: string;
351
- metadata: Record<string, string | number | boolean | null>;
352
357
  updatedAt: string;
358
+ metadata: Record<string, string | number | boolean | null>;
359
+ walletAddress: string | null;
353
360
  onchainMerchantId: number | null;
354
- businessName: string;
355
361
  tier: "free" | "growth" | "business" | "enterprise";
356
362
  payoutAddress: string | null;
357
363
  onboardingCompleted: boolean;
@@ -362,13 +368,13 @@ declare const loginOutputSchema: z.ZodObject<{
362
368
  whitelabelEnabled: boolean;
363
369
  }, {
364
370
  status: "active" | "suspended" | "closed";
371
+ businessName: string;
372
+ email: string;
365
373
  id: string;
366
- walletAddress: string | null;
367
374
  createdAt: string;
368
- email: string;
369
375
  updatedAt: string;
376
+ walletAddress: string | null;
370
377
  onchainMerchantId: number | null;
371
- businessName: string;
372
378
  tier: "free" | "growth" | "business" | "enterprise";
373
379
  payoutAddress: string | null;
374
380
  onboardingCompleted: boolean;
@@ -384,14 +390,14 @@ declare const loginOutputSchema: z.ZodObject<{
384
390
  refreshToken: string;
385
391
  merchant: {
386
392
  status: "active" | "suspended" | "closed";
393
+ businessName: string;
394
+ email: string;
387
395
  id: string;
388
- walletAddress: string | null;
389
396
  createdAt: string;
390
- email: string;
391
- metadata: Record<string, string | number | boolean | null>;
392
397
  updatedAt: string;
398
+ metadata: Record<string, string | number | boolean | null>;
399
+ walletAddress: string | null;
393
400
  onchainMerchantId: number | null;
394
- businessName: string;
395
401
  tier: "free" | "growth" | "business" | "enterprise";
396
402
  payoutAddress: string | null;
397
403
  onboardingCompleted: boolean;
@@ -406,13 +412,13 @@ declare const loginOutputSchema: z.ZodObject<{
406
412
  refreshToken: string;
407
413
  merchant: {
408
414
  status: "active" | "suspended" | "closed";
415
+ businessName: string;
416
+ email: string;
409
417
  id: string;
410
- walletAddress: string | null;
411
418
  createdAt: string;
412
- email: string;
413
419
  updatedAt: string;
420
+ walletAddress: string | null;
414
421
  onchainMerchantId: number | null;
415
- businessName: string;
416
422
  tier: "free" | "growth" | "business" | "enterprise";
417
423
  payoutAddress: string | null;
418
424
  onboardingCompleted: boolean;
@@ -426,4 +432,4 @@ declare const loginOutputSchema: z.ZodObject<{
426
432
  }>;
427
433
  type LoginOutput = z.infer<typeof loginOutputSchema>;
428
434
 
429
- export { type ChangeTierInput, type CreateMerchantInput, DEFAULT_MERCHANT_EMAIL_PREFS, type InviteMemberInput, type LoginInput, type LoginOutput, type Merchant, type MerchantBalanceView, type MerchantEmailPrefs, type MerchantMember, type MerchantPublicBrand, type MerchantRole, type MerchantStatus, type OnboardMerchantInput, type UpdateMerchantInput, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, onboardMerchantInputSchema, updateMerchantInputSchema };
435
+ export { type ChangeTierInput, type ChangeTierParsed, type CreateMerchantInput, type CreateMerchantParsed, DEFAULT_MERCHANT_EMAIL_PREFS, type InviteMemberInput, type InviteMemberParsed, type LoginInput, type LoginOutput, type LoginParsed, type Merchant, type MerchantBalanceView, type MerchantEmailPrefs, type MerchantMember, type MerchantPublicBrand, type MerchantRole, type MerchantStatus, type OnboardMerchantInput, type OnboardMerchantParsed, type UpdateMerchantInput, type UpdateMerchantParsed, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, onboardMerchantInputSchema, updateMerchantInputSchema };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/merchants.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmB,CAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAGJ,CAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D;AAGtF,IAAM,WAAA,GAAc,CAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG,CAAA;AAG5C,CAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAG0B,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOP,CAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC,CAAA,IAAK,IAAI,cAAc;AAGtB,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,EAAI,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CA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AAO;AAAA,EACvB,QAAA,EAAU;AACZ,CAAC","file":"merchants.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.infer<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Merchant entity and lifecycle DTOs.\n *\n * A merchant is the platform's first-class tenant. Merchants have a tier,\n * a payout wallet address, and an on-chain merchantId registered in the\n * StrimzRegistry contract.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n merchantTierSchema,\n metadataSchema,\n} from './common.js'\n\nexport const merchantStatusSchema = z.enum(['active', 'suspended', 'closed'])\nexport type MerchantStatus = z.infer<typeof merchantStatusSchema>\n\nexport const merchantRoleSchema = z.enum(['owner', 'admin', 'developer', 'read_only'])\nexport type MerchantRole = z.infer<typeof merchantRoleSchema>\n\nexport const merchantSchema = z.object({\n id: idSchema,\n onchainMerchantId: z.number().int().nonnegative().nullable(),\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n tier: merchantTierSchema,\n status: merchantStatusSchema,\n payoutAddress: evmAddressSchema.nullable(),\n walletAddress: evmAddressSchema.nullable(),\n onboardingCompleted: z.boolean(),\n defaultCurrency: z.enum(['USDC', 'EURC']),\n countryCode: z.string().length(2).nullable(),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n whitelabelEnabled: z.boolean(),\n metadata: metadataSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Merchant = z.infer<typeof merchantSchema>\n\n// ---------- DTOs ----------\n\nexport const createMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n password: z.string().min(12).max(128),\n countryCode: z.string().length(2).optional(),\n websiteUrl: z.string().url().optional(),\n})\nexport type CreateMerchantInput = z.infer<typeof createMerchantInputSchema>\n\n/**\n * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.\n * Both default to true. Welcome, refunds, and admin broadcasts always send.\n */\nexport const merchantEmailPrefsSchema = z.object({\n /** \"You received X USDC\" one-off payment notifications. */\n paymentReceived: z.boolean(),\n /** \"You were paid X for subscription Y\" per-charge notifications. */\n subscriptionCharged: z.boolean(),\n})\nexport type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>\n\nexport const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs = {\n paymentReceived: true,\n subscriptionCharged: true,\n}\n\nexport const updateMerchantInputSchema = z\n .object({\n businessName: z.string().min(2).max(120),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n countryCode: z.string().length(2).nullable(),\n metadata: metadataSchema,\n emailPrefs: merchantEmailPrefsSchema.partial(),\n })\n .partial()\nexport type UpdateMerchantInput = z.infer<typeof updateMerchantInputSchema>\n\nexport const changeTierInputSchema = z.object({\n tier: merchantTierSchema,\n})\nexport type ChangeTierInput = z.infer<typeof changeTierInputSchema>\n\n/**\n * Self-attested onboarding form the dashboard collects after a\n * merchant first logs in via Privy. On success the API stamps\n * `onboardingCompleted: true` on the row, and the dashboard exits\n * the wizard. Shared here so the API's DTO and the web client's\n * hook can enforce the same shape.\n */\nexport const onboardMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n businessSector: z.string().min(2).max(80),\n countryCode: z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be a 2-letter ISO country code'),\n websiteUrl: z.string().url().optional(),\n logoUrl: z.string().url().optional(),\n phone: z.string().min(6).max(20).optional(),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']).optional(),\n})\nexport type OnboardMerchantInput = z.infer<typeof onboardMerchantInputSchema>\n\nexport const merchantPublicBrandSchema = z.object({\n id: idSchema,\n businessName: z.string().min(2).max(120),\n logoUrl: z.string().url().nullable(),\n walletAddress: evmAddressSchema.nullable(),\n})\nexport type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>\n\n/**\n * On-chain balance view for the withdraw page. Strimz is\n * non-custodial: payments settle directly into the merchant's\n * `payoutAddress`, and \"withdrawal\" means the merchant transferring\n * out with their own wallet. This shape reports current on-chain\n * state so the dashboard renders live balances + decides whether to\n * offer the signing UI.\n */\nexport const merchantBalanceSchema = z.object({\n /** Payout wallet, checksummed; null when the merchant hasn't set one. */\n payoutAddress: evmAddressSchema.nullable(),\n /** Privy embedded wallet, checksummed if resolvable. */\n walletAddress: evmAddressSchema.nullable(),\n /**\n * True when `payoutAddress === walletAddress`, i.e. the merchant\n * can sign a transfer from the dashboard via Privy. False for\n * merchants using an external wallet as payout — the UI falls back\n * to \"copy the address, transfer with your wallet.\"\n */\n canSignFromDashboard: z.boolean(),\n balances: z.array(\n z.object({\n currency: z.enum(['USDC', 'EURC']),\n contractAddress: evmAddressSchema,\n /** Base-6 integer as string. */\n raw: z.string(),\n /** Human-formatted, e.g. `1234.56`. */\n formatted: z.string(),\n decimals: z.number().int().min(0).max(30),\n }),\n ),\n})\nexport type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>\n\n// ---------- Team members ----------\n\nexport const merchantMemberSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n email: emailSchema,\n role: merchantRoleSchema,\n invitedAt: isoTimestampSchema,\n acceptedAt: isoTimestampSchema.nullable(),\n})\nexport type MerchantMember = z.infer<typeof merchantMemberSchema>\n\nexport const inviteMemberInputSchema = z.object({\n email: emailSchema,\n role: merchantRoleSchema,\n})\nexport type InviteMemberInput = z.infer<typeof inviteMemberInputSchema>\n\n// ---------- Auth ----------\n\nexport const loginInputSchema = z.object({\n email: emailSchema,\n password: z.string().min(1).max(128),\n})\nexport type LoginInput = z.infer<typeof loginInputSchema>\n\nexport const loginOutputSchema = z.object({\n accessToken: z.string(),\n refreshToken: z.string(),\n merchant: merchantSchema,\n})\nexport type LoginOutput = z.infer<typeof loginOutputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/merchants.ts"],"names":["z"],"mappings":";;;AAQO,IAAM,QAAA,GAAW,CAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM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QAAA,EAAUA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE;AAAA,KACzC;AAAA;AAEL,CAAC;AAKM,IAAM,oBAAA,GAAuBA,EAAE,MAAA,CAAO;AAAA,EAC3C,EAAA,EAAI,QAAA;AAAA,EACJ,UAAA,EAAY,QAAA;AAAA,EACZ,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM,kBAAA;AAAA,EACN,SAAA,EAAW,kBAAA;AAAA,EACX,UAAA,EAAY,mBAAmB,QAAA;AACjC,CAAC;AAGM,IAAM,uBAAA,GAA0BA,EAAE,MAAA,CAAO;AAAA,EAC9C,KAAA,EAAO,WAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAC;AAMM,IAAM,gBAAA,GAAmBA,EAAE,MAAA,CAAO;AAAA,EACvC,KAAA,EAAO,WAAA;AAAA,EACP,QAAA,EAAUA,EAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA,CAAE,IAAI,GAAG;AACrC,CAAC;AAIM,IAAM,iBAAA,GAAoBA,EAAE,MAAA,CAAO;AAAA,EACxC,WAAA,EAAaA,EAAE,MAAA,EAAO;AAAA,EACtB,YAAA,EAAcA,EAAE,MAAA,EAAO;AAAA,EACvB,QAAA,EAAU;AACZ,CAAC","file":"merchants.js","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Merchant entity and lifecycle DTOs.\n *\n * A merchant is the platform's first-class tenant. Merchants have a tier,\n * a payout wallet address, and an on-chain merchantId registered in the\n * StrimzRegistry contract.\n */\n\nimport { z } from 'zod'\nimport {\n emailSchema,\n evmAddressSchema,\n idSchema,\n isoTimestampSchema,\n merchantTierSchema,\n metadataSchema,\n} from './common.js'\n\nexport const merchantStatusSchema = z.enum(['active', 'suspended', 'closed'])\nexport type MerchantStatus = z.infer<typeof merchantStatusSchema>\n\nexport const merchantRoleSchema = z.enum(['owner', 'admin', 'developer', 'read_only'])\nexport type MerchantRole = z.infer<typeof merchantRoleSchema>\n\nexport const merchantSchema = z.object({\n id: idSchema,\n onchainMerchantId: z.number().int().nonnegative().nullable(),\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n tier: merchantTierSchema,\n status: merchantStatusSchema,\n payoutAddress: evmAddressSchema.nullable(),\n walletAddress: evmAddressSchema.nullable(),\n onboardingCompleted: z.boolean(),\n defaultCurrency: z.enum(['USDC', 'EURC']),\n countryCode: z.string().length(2).nullable(),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n whitelabelEnabled: z.boolean(),\n metadata: metadataSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type Merchant = z.infer<typeof merchantSchema>\n\n// ---------- DTOs ----------\n\nexport const createMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n email: emailSchema,\n password: z.string().min(12).max(128),\n countryCode: z.string().length(2).optional(),\n websiteUrl: z.string().url().optional(),\n})\nexport type CreateMerchantInput = z.input<typeof createMerchantInputSchema>\nexport type CreateMerchantParsed = z.output<typeof createMerchantInputSchema>\n\n/**\n * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.\n * Both default to true. Welcome, refunds, and admin broadcasts always send.\n */\nexport const merchantEmailPrefsSchema = z.object({\n /** \"You received X USDC\" one-off payment notifications. */\n paymentReceived: z.boolean(),\n /** \"You were paid X for subscription Y\" per-charge notifications. */\n subscriptionCharged: z.boolean(),\n})\nexport type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>\n\nexport const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs = {\n paymentReceived: true,\n subscriptionCharged: true,\n}\n\nexport const updateMerchantInputSchema = z\n .object({\n businessName: z.string().min(2).max(120),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']),\n websiteUrl: z.string().url().nullable(),\n logoUrl: z.string().url().nullable(),\n countryCode: z.string().length(2).nullable(),\n metadata: metadataSchema,\n emailPrefs: merchantEmailPrefsSchema.partial(),\n })\n .partial()\nexport type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>\nexport type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>\n\nexport const changeTierInputSchema = z.object({\n tier: merchantTierSchema,\n})\nexport type ChangeTierInput = z.input<typeof changeTierInputSchema>\nexport type ChangeTierParsed = z.output<typeof changeTierInputSchema>\n\n/**\n * Self-attested onboarding form the dashboard collects after a\n * merchant first logs in via Privy. On success the API stamps\n * `onboardingCompleted: true` on the row, and the dashboard exits\n * the wizard. Shared here so the API's DTO and the web client's\n * hook can enforce the same shape.\n */\nexport const onboardMerchantInputSchema = z.object({\n businessName: z.string().min(2).max(120),\n businessSector: z.string().min(2).max(80),\n countryCode: z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be a 2-letter ISO country code'),\n websiteUrl: z.string().url().optional(),\n logoUrl: z.string().url().optional(),\n phone: z.string().min(6).max(20).optional(),\n payoutAddress: evmAddressSchema,\n defaultCurrency: z.enum(['USDC', 'EURC']).optional(),\n})\nexport type OnboardMerchantInput = z.input<typeof onboardMerchantInputSchema>\nexport type OnboardMerchantParsed = z.output<typeof onboardMerchantInputSchema>\n\nexport const merchantPublicBrandSchema = z.object({\n id: idSchema,\n businessName: z.string().min(2).max(120),\n logoUrl: z.string().url().nullable(),\n walletAddress: evmAddressSchema.nullable(),\n})\nexport type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>\n\n/**\n * On-chain balance view for the withdraw page. Strimz is\n * non-custodial: payments settle directly into the merchant's\n * `payoutAddress`, and \"withdrawal\" means the merchant transferring\n * out with their own wallet. This shape reports current on-chain\n * state so the dashboard renders live balances + decides whether to\n * offer the signing UI.\n */\nexport const merchantBalanceSchema = z.object({\n /** Payout wallet, checksummed; null when the merchant hasn't set one. */\n payoutAddress: evmAddressSchema.nullable(),\n /** Privy embedded wallet, checksummed if resolvable. */\n walletAddress: evmAddressSchema.nullable(),\n /**\n * True when `payoutAddress === walletAddress`, i.e. the merchant\n * can sign a transfer from the dashboard via Privy. False for\n * merchants using an external wallet as payout — the UI falls back\n * to \"copy the address, transfer with your wallet.\"\n */\n canSignFromDashboard: z.boolean(),\n balances: z.array(\n z.object({\n currency: z.enum(['USDC', 'EURC']),\n contractAddress: evmAddressSchema,\n /** Base-6 integer as string. */\n raw: z.string(),\n /** Human-formatted, e.g. `1234.56`. */\n formatted: z.string(),\n decimals: z.number().int().min(0).max(30),\n }),\n ),\n})\nexport type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>\n\n// ---------- Team members ----------\n\nexport const merchantMemberSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n email: emailSchema,\n role: merchantRoleSchema,\n invitedAt: isoTimestampSchema,\n acceptedAt: isoTimestampSchema.nullable(),\n})\nexport type MerchantMember = z.infer<typeof merchantMemberSchema>\n\nexport const inviteMemberInputSchema = z.object({\n email: emailSchema,\n role: merchantRoleSchema,\n})\nexport type InviteMemberInput = z.input<typeof inviteMemberInputSchema>\nexport type InviteMemberParsed = z.output<typeof inviteMemberInputSchema>\n\n// ---------- Auth ----------\n\nexport const loginInputSchema = z.object({\n email: emailSchema,\n password: z.string().min(1).max(128),\n})\nexport type LoginInput = z.input<typeof loginInputSchema>\nexport type LoginParsed = z.output<typeof loginInputSchema>\n\nexport const loginOutputSchema = z.object({\n accessToken: z.string(),\n refreshToken: z.string(),\n merchant: merchantSchema,\n})\nexport type LoginOutput = z.infer<typeof loginOutputSchema>\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/payment-sessions.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5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A,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AAAA,EACD,aAAA,EAAe,eAAA;AAAA,EACf,YAAA,EAAc,gBAAgB,QAAA,EAAS;AAAA,EACvC,kBAAA,EAAoB;AACtB,CAAC","file":"payment-sessions.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.infer<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Payment session. A one-shot checkout intent.\n *\n * State machine:\n * created → awaiting_payment → submitted → confirmed\n * \\\n * → failed\n * → expired\n * → cancelled\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const paymentSessionStatusSchema = z.enum([\n 'created',\n 'awaiting_payment',\n 'submitted',\n 'confirmed',\n 'failed',\n 'expired',\n 'cancelled',\n])\nexport type PaymentSessionStatus = z.infer<typeof paymentSessionStatusSchema>\n\n/**\n * Merchant-supplied callback URL. The hosted checkout dispatches with\n * `window.location.href = redirectUrl` on completion / cancellation,\n * so we MUST reject anything other than `http://` and `https://`.\n *\n * Why this is a real risk: Zod's `.url()` validates RFC syntax, which\n * accepts `javascript:`, `data:`, `vbscript:`, `file:`, blob:`, etc.\n * A compromised merchant integration or an XSS upstream could ship a\n * session whose redirect URL executes script (or exfiltrates session\n * tokens) on every payer's browser. The damage is per-payer, but the\n * blast radius is \"every checkout the merchant runs.\"\n *\n * Mailto / tel and other handler protocols are also rejected — there\n * is no legitimate flow on a payment checkout that would benefit.\n */\nexport const callbackUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://') || v.startsWith('http://'), {\n message: 'must be an http:// or https:// URL',\n })\n\nexport const paymentSessionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n /**\n * On-chain StrimzRegistry merchant id (uint96) as a decimal string.\n * Set when the merchant has been registered on-chain; null when the\n * merchant exists in our DB but the registry transaction hasn't\n * been broadcast yet. Hosted checkout uses this to populate the\n * meta-tx calldata; if null, the checkout refuses to accept\n * payments.\n */\n chainMerchantId: z\n .string()\n .regex(/^[0-9]+$/u, 'must be a non-negative decimal integer string')\n .nullable(),\n /**\n * ERC-20 token contract address resolved from `currency` on the\n * active chain (Arc Testnet / Mainnet). Used as the `verifyingContract`\n * in the EIP-712 domain for both EIP-3009 and EIP-2612 signing.\n * Null on the (vanishingly unlikely) path where the API has no\n * configured address for the session's currency.\n */\n tokenAddress: evmAddressSchema.nullable(),\n customerId: idSchema.nullable(),\n status: paymentSessionStatusSchema,\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n description: z.string().max(500).nullable(),\n payerWalletAddress: evmAddressSchema.nullable(),\n payerEmail: z.string().email().nullable(),\n successUrl: callbackUrlSchema.nullable(),\n cancelUrl: callbackUrlSchema.nullable(),\n sourceChain: z\n .enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana'])\n .nullable(),\n bridgeTxHash: evmTxHashSchema.nullable(),\n onchainTxHash: evmTxHashSchema.nullable(),\n checkoutUrl: z.string().url(),\n metadata: metadataSchema,\n expiresAt: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type PaymentSession = z.infer<typeof paymentSessionSchema>\n\n// ---------- DTOs ----------\n\nexport const createPaymentSessionInputSchema = z.object({\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n description: z.string().max(500).optional(),\n customer: z\n .object({\n walletAddress: evmAddressSchema.optional(),\n email: z.string().email().optional(),\n externalRef: z.string().max(120).optional(),\n })\n .optional(),\n successUrl: z.string().url().optional(),\n cancelUrl: z.string().url().optional(),\n /** Minutes until the session expires. Default 30, max 60*24 (one day). */\n expiresInMinutes: z\n .number()\n .int()\n .min(1)\n .max(60 * 24)\n .default(30),\n /**\n * Allowed source chains a payer can bridge USDC from via CCTP. Omit to\n * accept every CCTP-supported chain.\n */\n supportedSourceChains: z\n .array(\n z.enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana']),\n )\n .optional(),\n metadata: metadataSchema.optional(),\n})\nexport type CreatePaymentSessionInput = z.infer<typeof createPaymentSessionInputSchema>\n\nexport const submitPaymentSessionInputSchema = z.object({\n sourceChain: z.enum([\n 'arc',\n 'ethereum',\n 'base',\n 'polygon',\n 'arbitrum',\n 'optimism',\n 'avalanche',\n 'solana',\n ]),\n onchainTxHash: evmTxHashSchema,\n bridgeTxHash: evmTxHashSchema.optional(),\n payerWalletAddress: evmAddressSchema,\n})\nexport type SubmitPaymentSessionInput = z.infer<typeof submitPaymentSessionInputSchema>\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/payment-sessions.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,MAAA,EAAO,CACP,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAE,CAAA,CACN,KAAA,CAAM,kBAAA,EAAoB,qBAAqB,CAAA;AAG3C,IAAM,gBAAA,GAAmBA,KAAA,CAC7B,MAAA,EAAO,CACP,KAAA,CAAM,qBAAA,EAAuB,oDAAoD,CAAA,CACjF,SAAA,CAAU,CAAC,CAAA,KAAM,CAAA,CAAE,aAAa,CAAA;AAG5B,IAAM,kBAAkBA,KAAA,CAC5B,MAAA,EAAO,CACP,KAAA,CAAM,uBAAuB,6DAA6D,CAAA;AAGlEA,KAAA,CAAE,MAAA,EAAO,CAAE,KAAA,EAAM,CAAE,IAAA,EAAK,CAAE,WAAA,EAAY,CAAE,GAAA,CAAI,GAAG;AAG5CA,KAAA,CAC3B,MAAA,EAAO,CACP,GAAA,EAAI,CACJ,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,UAAA,CAAW,UAAU,CAAA,EAAG;AAAA,EACvC,OAAA,EAAS;AACX,CAAC;AAG0BA,KAAA,CAAE,MAAA,EAAO,CAAE,GAAA;AAOjC,IAAM,iBAAA,GAAoBA,KAAA,CAC9B,MAAA,EAAO,CACP,MAAM,UAAA,EAAY,iDAAiD,CAAA,CACnE,MAAA,CAAO,CAAC,CAAA,KAAM,MAAA,CAAO,CAAC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,WAAWA,KAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,GAAM,QAAA,EAAS;AAAA;AAAA,EAErC,gBAAA,EAAkBA,KAAAA,CACf,MAAA,EAAO,CACP,KAAI,CACJ,GAAA,CAAI,CAAC,CAAA,CACL,GAAA,CAAI,EAAA,GAAK,EAAE,CAAA,CACX,QAAQ,EAAE,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKb,uBAAuBA,KAAAA,CACpB,KAAA;AAAA,IACCA,KAAAA,CAAE,IAAA,CAAK,CAAC,KAAA,EAAO,UAAA,EAAY,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,UAAA,EAAY,WAAA,EAAa,QAAQ,CAAC;AAAA,IAE7F,QAAA,EAAS;AAAA,EACZ,QAAA,EAAU,eAAe,QAAA;AAC3B,CAAC;AAIM,IAAM,+BAAA,GAAkCA,MAAE,MAAA,CAAO;AAAA,EACtD,WAAA,EAAaA,MAAE,IAAA,CAAK;AAAA,IAClB,KAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACD,CAAA;AAAA,EACD,aAAA,EAAe,eAAA;AAAA,EACf,YAAA,EAAc,gBAAgB,QAAA,EAAS;AAAA,EACvC,kBAAA,EAAoB;AACtB,CAAC","file":"payment-sessions.cjs","sourcesContent":["/**\n * Primitive schemas shared across every entity.\n * Every higher-level schema builds on these so validation is consistent.\n */\n\nimport { z } from 'zod'\n\n/** CUID2 or UUID-style opaque identifier. */\nexport const idSchema = z\n .string()\n .min(1)\n .max(64)\n .regex(/^[a-zA-Z0-9_-]+$/, 'id must be URL-safe')\n\n/** EVM address. Hex-encoded, 0x-prefixed, 20 bytes. Normalised to lowercase. */\nexport const evmAddressSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{40}$/, 'must be a 0x-prefixed 40-character hex EVM address')\n .transform((v) => v.toLowerCase())\n\n/** EVM transaction hash. 32-byte hex. */\nexport const evmTxHashSchema = z\n .string()\n .regex(/^0x[a-fA-F0-9]{64}$/, 'must be a 0x-prefixed 64-character hex EVM transaction hash')\n\n/** Email address, trimmed and lower-cased. */\nexport const emailSchema = z.string().email().trim().toLowerCase().max(320)\n\n/** HTTPS URL. No http:// allowed outside dev. */\nexport const httpsUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://'), {\n message: 'must be an https:// URL',\n })\n\n/** URL permitting http and https (dev + prod). */\nexport const httpUrlSchema = z.string().url()\n\n/**\n * Amount expressed in the token's smallest unit, serialised as a string to\n * preserve precision beyond `Number.MAX_SAFE_INTEGER`. For USDC (6 decimals),\n * 1 USDC is the string \"1000000\".\n */\nexport const tokenAmountSchema = z\n .string()\n .regex(/^[0-9]+$/, 'must be a non-negative integer string (base-10)')\n .refine((v) => BigInt(v) >= 0n, 'must be >= 0')\n\n/** Unsigned integer up to 2^53 - 1; validated and returned as number. */\nexport const uintSchema = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER)\n\n/** ISO-8601 timestamp string (`.toISOString()`-compatible). */\nexport const isoTimestampSchema = z\n .string()\n .datetime({ offset: true, message: 'must be an ISO-8601 timestamp' })\n\n/** Two-letter ISO-3166 country code. */\nexport const countryCodeSchema = z\n .string()\n .length(2)\n .regex(/^[A-Z]{2}$/, 'must be an ISO-3166 alpha-2 country code')\n\n/** Pagination inputs used by every list endpoint. */\nexport const paginationInputSchema = z.object({\n limit: z.number().int().min(1).max(100).default(25),\n cursor: z.string().min(1).max(200).nullish(),\n})\nexport type PaginationInput = z.input<typeof paginationInputSchema>\nexport type PaginationParsed = z.output<typeof paginationInputSchema>\n\n/** Pagination envelope used by every list response. */\nexport const makePaginatedSchema = <T extends z.ZodTypeAny>(item: T) =>\n z.object({\n data: z.array(item),\n nextCursor: z.string().nullable(),\n hasMore: z.boolean(),\n })\n\n/** Free-form metadata bag the API round-trips for merchants. */\nexport const metadataSchema = z\n .record(\n z.string().min(1).max(40),\n z.union([z.string().max(500), z.number(), z.boolean(), z.null()]),\n )\n .refine((m) => Object.keys(m).length <= 50, 'at most 50 metadata keys')\n .default({})\n\n/** Environment mode carried on every mode-scoped resource. */\nexport const modeSchema = z.enum(['test', 'live'])\nexport type Mode = z.infer<typeof modeSchema>\n\n/** Payment token enum. */\nexport const paymentCurrencySchema = z.enum(['USDC', 'EURC'])\nexport type PaymentCurrency = z.infer<typeof paymentCurrencySchema>\n\n/** Every display-level currency (payment + treasury). */\nexport const tokenSymbolSchema = z.enum(['USDC', 'EURC', 'USYC'])\nexport type TokenSymbol = z.infer<typeof tokenSymbolSchema>\n\n/** Merchant tier enum. */\nexport const merchantTierSchema = z.enum(['free', 'growth', 'business', 'enterprise'])\nexport type MerchantTier = z.infer<typeof merchantTierSchema>\n\n/** Arc environment enum. */\nexport const arcEnvironmentSchema = z.enum(['testnet', 'mainnet'])\nexport type ArcEnvironment = z.infer<typeof arcEnvironmentSchema>\n\nexport type Id = z.infer<typeof idSchema>\nexport type EvmAddress = z.infer<typeof evmAddressSchema>\nexport type EvmTxHash = z.infer<typeof evmTxHashSchema>\nexport type TokenAmount = z.infer<typeof tokenAmountSchema>\nexport type IsoTimestamp = z.infer<typeof isoTimestampSchema>\nexport type Metadata = z.infer<typeof metadataSchema>\n","/**\n * Payment session. A one-shot checkout intent.\n *\n * State machine:\n * created → awaiting_payment → submitted → confirmed\n * \\\n * → failed\n * → expired\n * → cancelled\n */\n\nimport { z } from 'zod'\nimport {\n evmAddressSchema,\n evmTxHashSchema,\n idSchema,\n isoTimestampSchema,\n metadataSchema,\n paymentCurrencySchema,\n tokenAmountSchema,\n} from './common.js'\n\nexport const paymentSessionStatusSchema = z.enum([\n 'created',\n 'awaiting_payment',\n 'submitted',\n 'confirmed',\n 'failed',\n 'expired',\n 'cancelled',\n])\nexport type PaymentSessionStatus = z.infer<typeof paymentSessionStatusSchema>\n\n/**\n * Merchant-supplied callback URL. The hosted checkout dispatches with\n * `window.location.href = redirectUrl` on completion / cancellation,\n * so we MUST reject anything other than `http://` and `https://`.\n *\n * Why this is a real risk: Zod's `.url()` validates RFC syntax, which\n * accepts `javascript:`, `data:`, `vbscript:`, `file:`, blob:`, etc.\n * A compromised merchant integration or an XSS upstream could ship a\n * session whose redirect URL executes script (or exfiltrates session\n * tokens) on every payer's browser. The damage is per-payer, but the\n * blast radius is \"every checkout the merchant runs.\"\n *\n * Mailto / tel and other handler protocols are also rejected — there\n * is no legitimate flow on a payment checkout that would benefit.\n */\nexport const callbackUrlSchema = z\n .string()\n .url()\n .refine((v) => v.startsWith('https://') || v.startsWith('http://'), {\n message: 'must be an http:// or https:// URL',\n })\n\nexport const paymentSessionSchema = z.object({\n id: idSchema,\n merchantId: idSchema,\n /**\n * On-chain StrimzRegistry merchant id (uint96) as a decimal string.\n * Set when the merchant has been registered on-chain; null when the\n * merchant exists in our DB but the registry transaction hasn't\n * been broadcast yet. Hosted checkout uses this to populate the\n * meta-tx calldata; if null, the checkout refuses to accept\n * payments.\n */\n chainMerchantId: z\n .string()\n .regex(/^[0-9]+$/u, 'must be a non-negative decimal integer string')\n .nullable(),\n /**\n * ERC-20 token contract address resolved from `currency` on the\n * active chain (Arc Testnet / Mainnet). Used as the `verifyingContract`\n * in the EIP-712 domain for both EIP-3009 and EIP-2612 signing.\n * Null on the (vanishingly unlikely) path where the API has no\n * configured address for the session's currency.\n */\n tokenAddress: evmAddressSchema.nullable(),\n customerId: idSchema.nullable(),\n status: paymentSessionStatusSchema,\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n feeAmount: tokenAmountSchema,\n netAmount: tokenAmountSchema,\n description: z.string().max(500).nullable(),\n payerWalletAddress: evmAddressSchema.nullable(),\n payerEmail: z.string().email().nullable(),\n successUrl: callbackUrlSchema.nullable(),\n cancelUrl: callbackUrlSchema.nullable(),\n sourceChain: z\n .enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana'])\n .nullable(),\n bridgeTxHash: evmTxHashSchema.nullable(),\n onchainTxHash: evmTxHashSchema.nullable(),\n checkoutUrl: z.string().url(),\n metadata: metadataSchema,\n expiresAt: isoTimestampSchema,\n createdAt: isoTimestampSchema,\n updatedAt: isoTimestampSchema,\n})\nexport type PaymentSession = z.infer<typeof paymentSessionSchema>\n\n// ---------- DTOs ----------\n\nexport const createPaymentSessionInputSchema = z.object({\n amount: tokenAmountSchema,\n currency: paymentCurrencySchema,\n description: z.string().max(500).optional(),\n customer: z\n .object({\n walletAddress: evmAddressSchema.optional(),\n email: z.string().email().optional(),\n externalRef: z.string().max(120).optional(),\n })\n .optional(),\n successUrl: z.string().url().optional(),\n cancelUrl: z.string().url().optional(),\n /** Minutes until the session expires. Default 30, max 60*24 (one day). */\n expiresInMinutes: z\n .number()\n .int()\n .min(1)\n .max(60 * 24)\n .default(30),\n /**\n * Allowed source chains a payer can bridge USDC from via CCTP. Omit to\n * accept every CCTP-supported chain.\n */\n supportedSourceChains: z\n .array(\n z.enum(['arc', 'ethereum', 'base', 'polygon', 'arbitrum', 'optimism', 'avalanche', 'solana']),\n )\n .optional(),\n metadata: metadataSchema.optional(),\n})\nexport type CreatePaymentSessionInput = z.input<typeof createPaymentSessionInputSchema>\nexport type CreatePaymentSessionParsed = z.output<typeof createPaymentSessionInputSchema>\n\nexport const submitPaymentSessionInputSchema = z.object({\n sourceChain: z.enum([\n 'arc',\n 'ethereum',\n 'base',\n 'polygon',\n 'arbitrum',\n 'optimism',\n 'avalanche',\n 'solana',\n ]),\n onchainTxHash: evmTxHashSchema,\n bridgeTxHash: evmTxHashSchema.optional(),\n payerWalletAddress: evmAddressSchema,\n})\nexport type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>\nexport type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>\n"]}
@@ -70,18 +70,18 @@ declare const paymentSessionSchema: z.ZodObject<{
70
70
  updatedAt: z.ZodString;
71
71
  }, "strip", z.ZodTypeAny, {
72
72
  status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
73
- id: string;
73
+ amount: string;
74
+ currency: "USDC" | "EURC";
75
+ customerId: string | null;
74
76
  merchantId: string;
77
+ description: string | null;
78
+ id: string;
75
79
  createdAt: string;
76
- metadata: Record<string, string | number | boolean | null>;
80
+ updatedAt: string;
77
81
  chainMerchantId: string | null;
78
82
  tokenAddress: string | null;
79
- customerId: string | null;
80
- amount: string;
81
- currency: "USDC" | "EURC";
82
83
  feeAmount: string;
83
84
  netAmount: string;
84
- description: string | null;
85
85
  payerWalletAddress: string | null;
86
86
  payerEmail: string | null;
87
87
  successUrl: string | null;
@@ -90,21 +90,22 @@ declare const paymentSessionSchema: z.ZodObject<{
90
90
  bridgeTxHash: string | null;
91
91
  onchainTxHash: string | null;
92
92
  checkoutUrl: string;
93
+ metadata: Record<string, string | number | boolean | null>;
93
94
  expiresAt: string;
94
- updatedAt: string;
95
95
  }, {
96
96
  status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
97
- id: string;
97
+ amount: string;
98
+ currency: "USDC" | "EURC";
99
+ customerId: string | null;
98
100
  merchantId: string;
101
+ description: string | null;
102
+ id: string;
99
103
  createdAt: string;
104
+ updatedAt: string;
100
105
  chainMerchantId: string | null;
101
106
  tokenAddress: string | null;
102
- customerId: string | null;
103
- amount: string;
104
- currency: "USDC" | "EURC";
105
107
  feeAmount: string;
106
108
  netAmount: string;
107
- description: string | null;
108
109
  payerWalletAddress: string | null;
109
110
  payerEmail: string | null;
110
111
  successUrl: string | null;
@@ -114,7 +115,6 @@ declare const paymentSessionSchema: z.ZodObject<{
114
115
  onchainTxHash: string | null;
115
116
  checkoutUrl: string;
116
117
  expiresAt: string;
117
- updatedAt: string;
118
118
  metadata?: Record<string, string | number | boolean | null> | undefined;
119
119
  }>;
120
120
  type PaymentSession = z.infer<typeof paymentSessionSchema>;
@@ -127,12 +127,12 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
127
127
  email: z.ZodOptional<z.ZodString>;
128
128
  externalRef: z.ZodOptional<z.ZodString>;
129
129
  }, "strip", z.ZodTypeAny, {
130
- walletAddress?: string | undefined;
131
130
  email?: string | undefined;
131
+ walletAddress?: string | undefined;
132
132
  externalRef?: string | undefined;
133
133
  }, {
134
- walletAddress?: string | undefined;
135
134
  email?: string | undefined;
135
+ walletAddress?: string | undefined;
136
136
  externalRef?: string | undefined;
137
137
  }>>;
138
138
  successUrl: z.ZodOptional<z.ZodString>;
@@ -149,32 +149,33 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
149
149
  amount: string;
150
150
  currency: "USDC" | "EURC";
151
151
  expiresInMinutes: number;
152
- metadata?: Record<string, string | number | boolean | null> | undefined;
153
152
  description?: string | undefined;
154
153
  successUrl?: string | undefined;
155
154
  cancelUrl?: string | undefined;
155
+ metadata?: Record<string, string | number | boolean | null> | undefined;
156
156
  customer?: {
157
- walletAddress?: string | undefined;
158
157
  email?: string | undefined;
158
+ walletAddress?: string | undefined;
159
159
  externalRef?: string | undefined;
160
160
  } | undefined;
161
161
  supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
162
162
  }, {
163
163
  amount: string;
164
164
  currency: "USDC" | "EURC";
165
- metadata?: Record<string, string | number | boolean | null> | undefined;
166
165
  description?: string | undefined;
167
166
  successUrl?: string | undefined;
168
167
  cancelUrl?: string | undefined;
168
+ metadata?: Record<string, string | number | boolean | null> | undefined;
169
169
  customer?: {
170
- walletAddress?: string | undefined;
171
170
  email?: string | undefined;
171
+ walletAddress?: string | undefined;
172
172
  externalRef?: string | undefined;
173
173
  } | undefined;
174
174
  expiresInMinutes?: number | undefined;
175
175
  supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
176
176
  }>;
177
- type CreatePaymentSessionInput = z.infer<typeof createPaymentSessionInputSchema>;
177
+ type CreatePaymentSessionInput = z.input<typeof createPaymentSessionInputSchema>;
178
+ type CreatePaymentSessionParsed = z.output<typeof createPaymentSessionInputSchema>;
178
179
  declare const submitPaymentSessionInputSchema: z.ZodObject<{
179
180
  sourceChain: z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>;
180
181
  onchainTxHash: z.ZodString;
@@ -191,6 +192,7 @@ declare const submitPaymentSessionInputSchema: z.ZodObject<{
191
192
  onchainTxHash: string;
192
193
  bridgeTxHash?: string | undefined;
193
194
  }>;
194
- type SubmitPaymentSessionInput = z.infer<typeof submitPaymentSessionInputSchema>;
195
+ type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>;
196
+ type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>;
195
197
 
196
- export { type CreatePaymentSessionInput, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
198
+ export { type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
@@ -70,18 +70,18 @@ declare const paymentSessionSchema: z.ZodObject<{
70
70
  updatedAt: z.ZodString;
71
71
  }, "strip", z.ZodTypeAny, {
72
72
  status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
73
- id: string;
73
+ amount: string;
74
+ currency: "USDC" | "EURC";
75
+ customerId: string | null;
74
76
  merchantId: string;
77
+ description: string | null;
78
+ id: string;
75
79
  createdAt: string;
76
- metadata: Record<string, string | number | boolean | null>;
80
+ updatedAt: string;
77
81
  chainMerchantId: string | null;
78
82
  tokenAddress: string | null;
79
- customerId: string | null;
80
- amount: string;
81
- currency: "USDC" | "EURC";
82
83
  feeAmount: string;
83
84
  netAmount: string;
84
- description: string | null;
85
85
  payerWalletAddress: string | null;
86
86
  payerEmail: string | null;
87
87
  successUrl: string | null;
@@ -90,21 +90,22 @@ declare const paymentSessionSchema: z.ZodObject<{
90
90
  bridgeTxHash: string | null;
91
91
  onchainTxHash: string | null;
92
92
  checkoutUrl: string;
93
+ metadata: Record<string, string | number | boolean | null>;
93
94
  expiresAt: string;
94
- updatedAt: string;
95
95
  }, {
96
96
  status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
97
- id: string;
97
+ amount: string;
98
+ currency: "USDC" | "EURC";
99
+ customerId: string | null;
98
100
  merchantId: string;
101
+ description: string | null;
102
+ id: string;
99
103
  createdAt: string;
104
+ updatedAt: string;
100
105
  chainMerchantId: string | null;
101
106
  tokenAddress: string | null;
102
- customerId: string | null;
103
- amount: string;
104
- currency: "USDC" | "EURC";
105
107
  feeAmount: string;
106
108
  netAmount: string;
107
- description: string | null;
108
109
  payerWalletAddress: string | null;
109
110
  payerEmail: string | null;
110
111
  successUrl: string | null;
@@ -114,7 +115,6 @@ declare const paymentSessionSchema: z.ZodObject<{
114
115
  onchainTxHash: string | null;
115
116
  checkoutUrl: string;
116
117
  expiresAt: string;
117
- updatedAt: string;
118
118
  metadata?: Record<string, string | number | boolean | null> | undefined;
119
119
  }>;
120
120
  type PaymentSession = z.infer<typeof paymentSessionSchema>;
@@ -127,12 +127,12 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
127
127
  email: z.ZodOptional<z.ZodString>;
128
128
  externalRef: z.ZodOptional<z.ZodString>;
129
129
  }, "strip", z.ZodTypeAny, {
130
- walletAddress?: string | undefined;
131
130
  email?: string | undefined;
131
+ walletAddress?: string | undefined;
132
132
  externalRef?: string | undefined;
133
133
  }, {
134
- walletAddress?: string | undefined;
135
134
  email?: string | undefined;
135
+ walletAddress?: string | undefined;
136
136
  externalRef?: string | undefined;
137
137
  }>>;
138
138
  successUrl: z.ZodOptional<z.ZodString>;
@@ -149,32 +149,33 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
149
149
  amount: string;
150
150
  currency: "USDC" | "EURC";
151
151
  expiresInMinutes: number;
152
- metadata?: Record<string, string | number | boolean | null> | undefined;
153
152
  description?: string | undefined;
154
153
  successUrl?: string | undefined;
155
154
  cancelUrl?: string | undefined;
155
+ metadata?: Record<string, string | number | boolean | null> | undefined;
156
156
  customer?: {
157
- walletAddress?: string | undefined;
158
157
  email?: string | undefined;
158
+ walletAddress?: string | undefined;
159
159
  externalRef?: string | undefined;
160
160
  } | undefined;
161
161
  supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
162
162
  }, {
163
163
  amount: string;
164
164
  currency: "USDC" | "EURC";
165
- metadata?: Record<string, string | number | boolean | null> | undefined;
166
165
  description?: string | undefined;
167
166
  successUrl?: string | undefined;
168
167
  cancelUrl?: string | undefined;
168
+ metadata?: Record<string, string | number | boolean | null> | undefined;
169
169
  customer?: {
170
- walletAddress?: string | undefined;
171
170
  email?: string | undefined;
171
+ walletAddress?: string | undefined;
172
172
  externalRef?: string | undefined;
173
173
  } | undefined;
174
174
  expiresInMinutes?: number | undefined;
175
175
  supportedSourceChains?: ("arc" | "ethereum" | "base" | "polygon" | "arbitrum" | "optimism" | "avalanche" | "solana")[] | undefined;
176
176
  }>;
177
- type CreatePaymentSessionInput = z.infer<typeof createPaymentSessionInputSchema>;
177
+ type CreatePaymentSessionInput = z.input<typeof createPaymentSessionInputSchema>;
178
+ type CreatePaymentSessionParsed = z.output<typeof createPaymentSessionInputSchema>;
178
179
  declare const submitPaymentSessionInputSchema: z.ZodObject<{
179
180
  sourceChain: z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>;
180
181
  onchainTxHash: z.ZodString;
@@ -191,6 +192,7 @@ declare const submitPaymentSessionInputSchema: z.ZodObject<{
191
192
  onchainTxHash: string;
192
193
  bridgeTxHash?: string | undefined;
193
194
  }>;
194
- type SubmitPaymentSessionInput = z.infer<typeof submitPaymentSessionInputSchema>;
195
+ type SubmitPaymentSessionInput = z.input<typeof submitPaymentSessionInputSchema>;
196
+ type SubmitPaymentSessionParsed = z.output<typeof submitPaymentSessionInputSchema>;
195
197
 
196
- export { type CreatePaymentSessionInput, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };
198
+ export { type CreatePaymentSessionInput, type CreatePaymentSessionParsed, type PaymentSession, type PaymentSessionStatus, type SubmitPaymentSessionInput, type SubmitPaymentSessionParsed, callbackUrlSchema, createPaymentSessionInputSchema, paymentSessionSchema, paymentSessionStatusSchema, submitPaymentSessionInputSchema };