@strimz/shared-types 0.11.2 → 0.12.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.
- package/dist/agents.cjs +1 -1
- package/dist/agents.cjs.map +1 -1
- package/dist/agents.js +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.d.cts +136 -136
- package/dist/analytics.d.ts +136 -136
- package/dist/analytics.js +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/api-keys.cjs +1 -1
- package/dist/api-keys.cjs.map +1 -1
- package/dist/api-keys.d.cts +20 -20
- package/dist/api-keys.d.ts +20 -20
- package/dist/api-keys.js +1 -1
- package/dist/api-keys.js.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.d.cts +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/common.js.map +1 -1
- package/dist/compliance.cjs +1 -1
- package/dist/compliance.cjs.map +1 -1
- package/dist/compliance.d.cts +4 -4
- package/dist/compliance.d.ts +4 -4
- package/dist/compliance.js +1 -1
- package/dist/compliance.js.map +1 -1
- package/dist/customers.cjs +1 -1
- package/dist/customers.cjs.map +1 -1
- package/dist/customers.d.cts +6 -6
- package/dist/customers.d.ts +6 -6
- package/dist/customers.js +1 -1
- package/dist/customers.js.map +1 -1
- package/dist/events.cjs +1 -1
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +1433 -1433
- package/dist/events.d.ts +1433 -1433
- package/dist/events.js +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invoices.cjs +1 -1
- package/dist/invoices.cjs.map +1 -1
- package/dist/invoices.d.cts +10 -10
- package/dist/invoices.d.ts +10 -10
- package/dist/invoices.js +1 -1
- package/dist/invoices.js.map +1 -1
- package/dist/merchants.cjs +1 -1
- package/dist/merchants.cjs.map +1 -1
- package/dist/merchants.d.cts +31 -31
- package/dist/merchants.d.ts +31 -31
- package/dist/merchants.js +1 -1
- package/dist/merchants.js.map +1 -1
- package/dist/payment-sessions.cjs +1 -1
- package/dist/payment-sessions.cjs.map +1 -1
- package/dist/payment-sessions.d.cts +16 -16
- package/dist/payment-sessions.d.ts +16 -16
- package/dist/payment-sessions.js +1 -1
- package/dist/payment-sessions.js.map +1 -1
- package/dist/refunds.cjs +1 -1
- package/dist/refunds.cjs.map +1 -1
- package/dist/refunds.d.cts +36 -36
- package/dist/refunds.d.ts +36 -36
- package/dist/refunds.js +1 -1
- package/dist/refunds.js.map +1 -1
- package/dist/storefronts.cjs +1 -1
- package/dist/storefronts.cjs.map +1 -1
- package/dist/storefronts.d.cts +27 -27
- package/dist/storefronts.d.ts +27 -27
- package/dist/storefronts.js +1 -1
- package/dist/storefronts.js.map +1 -1
- package/dist/subscriptions.cjs +1 -1
- package/dist/subscriptions.cjs.map +1 -1
- package/dist/subscriptions.d.cts +30 -30
- package/dist/subscriptions.d.ts +30 -30
- package/dist/subscriptions.js +1 -1
- package/dist/subscriptions.js.map +1 -1
- package/dist/transactions.cjs +1 -1
- package/dist/transactions.cjs.map +1 -1
- package/dist/transactions.d.cts +12 -12
- package/dist/transactions.d.ts +12 -12
- package/dist/transactions.js +1 -1
- package/dist/transactions.js.map +1 -1
- package/dist/webhooks.cjs +1 -1
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.d.cts +22 -22
- package/dist/webhooks.d.ts +22 -22
- package/dist/webhooks.js +1 -1
- package/dist/webhooks.js.map +1 -1
- package/package.json +4 -4
- package/src/common.ts +1 -1
package/dist/merchants.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ declare const merchantSchema: z.ZodObject<{
|
|
|
17
17
|
onchainMerchantId: z.ZodNullable<z.ZodNumber>;
|
|
18
18
|
businessName: z.ZodString;
|
|
19
19
|
email: z.ZodString;
|
|
20
|
-
tier: z.ZodEnum<["free", "
|
|
20
|
+
tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
|
|
21
21
|
status: z.ZodEnum<["active", "suspended", "closed"]>;
|
|
22
22
|
payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
23
23
|
walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
@@ -32,15 +32,15 @@ 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
38
|
createdAt: string;
|
|
37
39
|
updatedAt: string;
|
|
38
40
|
metadata: Record<string, string | number | boolean | null>;
|
|
39
41
|
walletAddress: string | null;
|
|
40
|
-
email: string;
|
|
41
|
-
businessName: string;
|
|
42
42
|
onchainMerchantId: number | null;
|
|
43
|
-
tier: "free" | "
|
|
43
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
44
44
|
payoutAddress: string | null;
|
|
45
45
|
onboardingCompleted: boolean;
|
|
46
46
|
defaultCurrency: "USDC" | "EURC";
|
|
@@ -50,14 +50,14 @@ 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
56
|
createdAt: string;
|
|
55
57
|
updatedAt: string;
|
|
56
58
|
walletAddress: string | null;
|
|
57
|
-
email: string;
|
|
58
|
-
businessName: string;
|
|
59
59
|
onchainMerchantId: number | null;
|
|
60
|
-
tier: "free" | "
|
|
60
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
61
61
|
payoutAddress: string | null;
|
|
62
62
|
onboardingCompleted: boolean;
|
|
63
63
|
defaultCurrency: "USDC" | "EURC";
|
|
@@ -75,14 +75,14 @@ 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;
|
|
@@ -126,8 +126,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
|
|
|
126
126
|
subscriptionCharged?: boolean | undefined;
|
|
127
127
|
}>>;
|
|
128
128
|
}, "strip", z.ZodTypeAny, {
|
|
129
|
-
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
130
129
|
businessName?: string | undefined;
|
|
130
|
+
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
131
131
|
payoutAddress?: string | undefined;
|
|
132
132
|
defaultCurrency?: "USDC" | "EURC" | undefined;
|
|
133
133
|
countryCode?: string | null | undefined;
|
|
@@ -138,8 +138,8 @@ declare const updateMerchantInputSchema: z.ZodObject<{
|
|
|
138
138
|
subscriptionCharged?: boolean | undefined;
|
|
139
139
|
} | undefined;
|
|
140
140
|
}, {
|
|
141
|
-
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
142
141
|
businessName?: string | undefined;
|
|
142
|
+
metadata?: Record<string, string | number | boolean | null> | undefined;
|
|
143
143
|
payoutAddress?: string | undefined;
|
|
144
144
|
defaultCurrency?: "USDC" | "EURC" | undefined;
|
|
145
145
|
countryCode?: string | null | undefined;
|
|
@@ -153,11 +153,11 @@ declare const updateMerchantInputSchema: z.ZodObject<{
|
|
|
153
153
|
type UpdateMerchantInput = z.input<typeof updateMerchantInputSchema>;
|
|
154
154
|
type UpdateMerchantParsed = z.output<typeof updateMerchantInputSchema>;
|
|
155
155
|
declare const changeTierInputSchema: z.ZodObject<{
|
|
156
|
-
tier: z.ZodEnum<["free", "
|
|
156
|
+
tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
|
|
157
157
|
}, "strip", z.ZodTypeAny, {
|
|
158
|
-
tier: "free" | "
|
|
158
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
159
159
|
}, {
|
|
160
|
-
tier: "free" | "
|
|
160
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
161
161
|
}>;
|
|
162
162
|
type ChangeTierInput = z.input<typeof changeTierInputSchema>;
|
|
163
163
|
type ChangeTierParsed = z.output<typeof changeTierInputSchema>;
|
|
@@ -204,14 +204,14 @@ declare const merchantPublicBrandSchema: z.ZodObject<{
|
|
|
204
204
|
logoUrl: z.ZodNullable<z.ZodString>;
|
|
205
205
|
walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
206
206
|
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
businessName: string;
|
|
207
208
|
id: string;
|
|
208
209
|
walletAddress: string | null;
|
|
209
|
-
businessName: string;
|
|
210
210
|
logoUrl: string | null;
|
|
211
211
|
}, {
|
|
212
|
+
businessName: string;
|
|
212
213
|
id: string;
|
|
213
214
|
walletAddress: string | null;
|
|
214
|
-
businessName: string;
|
|
215
215
|
logoUrl: string | null;
|
|
216
216
|
}>;
|
|
217
217
|
type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
|
|
@@ -288,16 +288,16 @@ declare const merchantMemberSchema: z.ZodObject<{
|
|
|
288
288
|
invitedAt: z.ZodString;
|
|
289
289
|
acceptedAt: z.ZodNullable<z.ZodString>;
|
|
290
290
|
}, "strip", z.ZodTypeAny, {
|
|
291
|
-
id: string;
|
|
292
291
|
merchantId: string;
|
|
293
292
|
email: string;
|
|
293
|
+
id: string;
|
|
294
294
|
role: "owner" | "admin" | "developer" | "read_only";
|
|
295
295
|
invitedAt: string;
|
|
296
296
|
acceptedAt: string | null;
|
|
297
297
|
}, {
|
|
298
|
-
id: string;
|
|
299
298
|
merchantId: string;
|
|
300
299
|
email: string;
|
|
300
|
+
id: string;
|
|
301
301
|
role: "owner" | "admin" | "developer" | "read_only";
|
|
302
302
|
invitedAt: string;
|
|
303
303
|
acceptedAt: string | null;
|
|
@@ -335,7 +335,7 @@ declare const loginOutputSchema: z.ZodObject<{
|
|
|
335
335
|
onchainMerchantId: z.ZodNullable<z.ZodNumber>;
|
|
336
336
|
businessName: z.ZodString;
|
|
337
337
|
email: z.ZodString;
|
|
338
|
-
tier: z.ZodEnum<["free", "
|
|
338
|
+
tier: z.ZodEnum<["free", "starter", "growth", "enterprise"]>;
|
|
339
339
|
status: z.ZodEnum<["active", "suspended", "closed"]>;
|
|
340
340
|
payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
341
341
|
walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
|
|
@@ -350,15 +350,15 @@ declare const loginOutputSchema: z.ZodObject<{
|
|
|
350
350
|
updatedAt: z.ZodString;
|
|
351
351
|
}, "strip", z.ZodTypeAny, {
|
|
352
352
|
status: "active" | "suspended" | "closed";
|
|
353
|
+
businessName: string;
|
|
354
|
+
email: string;
|
|
353
355
|
id: string;
|
|
354
356
|
createdAt: string;
|
|
355
357
|
updatedAt: string;
|
|
356
358
|
metadata: Record<string, string | number | boolean | null>;
|
|
357
359
|
walletAddress: string | null;
|
|
358
|
-
email: string;
|
|
359
|
-
businessName: string;
|
|
360
360
|
onchainMerchantId: number | null;
|
|
361
|
-
tier: "free" | "
|
|
361
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
362
362
|
payoutAddress: string | null;
|
|
363
363
|
onboardingCompleted: boolean;
|
|
364
364
|
defaultCurrency: "USDC" | "EURC";
|
|
@@ -368,14 +368,14 @@ declare const loginOutputSchema: z.ZodObject<{
|
|
|
368
368
|
whitelabelEnabled: boolean;
|
|
369
369
|
}, {
|
|
370
370
|
status: "active" | "suspended" | "closed";
|
|
371
|
+
businessName: string;
|
|
372
|
+
email: string;
|
|
371
373
|
id: string;
|
|
372
374
|
createdAt: string;
|
|
373
375
|
updatedAt: string;
|
|
374
376
|
walletAddress: string | null;
|
|
375
|
-
email: string;
|
|
376
|
-
businessName: string;
|
|
377
377
|
onchainMerchantId: number | null;
|
|
378
|
-
tier: "free" | "
|
|
378
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
379
379
|
payoutAddress: string | null;
|
|
380
380
|
onboardingCompleted: boolean;
|
|
381
381
|
defaultCurrency: "USDC" | "EURC";
|
|
@@ -390,15 +390,15 @@ declare const loginOutputSchema: z.ZodObject<{
|
|
|
390
390
|
refreshToken: string;
|
|
391
391
|
merchant: {
|
|
392
392
|
status: "active" | "suspended" | "closed";
|
|
393
|
+
businessName: string;
|
|
394
|
+
email: string;
|
|
393
395
|
id: string;
|
|
394
396
|
createdAt: string;
|
|
395
397
|
updatedAt: string;
|
|
396
398
|
metadata: Record<string, string | number | boolean | null>;
|
|
397
399
|
walletAddress: string | null;
|
|
398
|
-
email: string;
|
|
399
|
-
businessName: string;
|
|
400
400
|
onchainMerchantId: number | null;
|
|
401
|
-
tier: "free" | "
|
|
401
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
402
402
|
payoutAddress: string | null;
|
|
403
403
|
onboardingCompleted: boolean;
|
|
404
404
|
defaultCurrency: "USDC" | "EURC";
|
|
@@ -412,14 +412,14 @@ declare const loginOutputSchema: z.ZodObject<{
|
|
|
412
412
|
refreshToken: string;
|
|
413
413
|
merchant: {
|
|
414
414
|
status: "active" | "suspended" | "closed";
|
|
415
|
+
businessName: string;
|
|
416
|
+
email: string;
|
|
415
417
|
id: string;
|
|
416
418
|
createdAt: string;
|
|
417
419
|
updatedAt: string;
|
|
418
420
|
walletAddress: string | null;
|
|
419
|
-
email: string;
|
|
420
|
-
businessName: string;
|
|
421
421
|
onchainMerchantId: number | null;
|
|
422
|
-
tier: "free" | "
|
|
422
|
+
tier: "free" | "starter" | "growth" | "enterprise";
|
|
423
423
|
payoutAddress: string | null;
|
|
424
424
|
onboardingCompleted: boolean;
|
|
425
425
|
defaultCurrency: "USDC" | "EURC";
|
package/dist/merchants.js
CHANGED
|
@@ -24,7 +24,7 @@ var metadataSchema = z.record(
|
|
|
24
24
|
z.enum(["test", "live"]);
|
|
25
25
|
z.enum(["USDC", "EURC"]);
|
|
26
26
|
z.enum(["USDC", "EURC", "USYC"]);
|
|
27
|
-
var merchantTierSchema = z.enum(["free", "
|
|
27
|
+
var merchantTierSchema = z.enum(["free", "starter", "growth", "enterprise"]);
|
|
28
28
|
z.enum(["testnet", "mainnet"]);
|
|
29
29
|
|
|
30
30
|
// src/merchants.ts
|
package/dist/merchants.js.map
CHANGED
|
@@ -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;AA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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\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
|
+
{"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,KAAA,CAAM,YAAY,iDAAiD;AAG5C,CAAA,CAAE,MA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,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\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', 'starter', 'growth', '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"]}
|
|
@@ -26,7 +26,7 @@ var metadataSchema = zod.z.record(
|
|
|
26
26
|
zod.z.enum(["test", "live"]);
|
|
27
27
|
var paymentCurrencySchema = zod.z.enum(["USDC", "EURC"]);
|
|
28
28
|
zod.z.enum(["USDC", "EURC", "USYC"]);
|
|
29
|
-
zod.z.enum(["free", "
|
|
29
|
+
zod.z.enum(["free", "starter", "growth", "enterprise"]);
|
|
30
30
|
zod.z.enum(["testnet", "mainnet"]);
|
|
31
31
|
|
|
32
32
|
// src/payment-sessions.ts
|
|
@@ -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;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,o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AE,GAAA,GAAM,QAAA,EAAS;AAAA,EACtC,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\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"]}
|
|
1
|
+
{"version":3,"sources":["../src/common.ts","../src/payment-sessions.ts"],"names":["z"],"mappings":";;;;;AAQO,IAAM,QAAA,GAAWA,KAAA,CACrB,M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C3B,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\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', 'starter', 'growth', '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,16 +70,16 @@ 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
|
-
|
|
73
|
+
amount: string;
|
|
74
|
+
currency: "USDC" | "EURC";
|
|
75
|
+
customerId: string | null;
|
|
74
76
|
merchantId: string;
|
|
75
|
-
createdAt: string;
|
|
76
77
|
description: string | null;
|
|
77
|
-
|
|
78
|
+
id: string;
|
|
79
|
+
createdAt: string;
|
|
78
80
|
updatedAt: string;
|
|
79
81
|
chainMerchantId: string | null;
|
|
80
82
|
tokenAddress: string | null;
|
|
81
|
-
customerId: string | null;
|
|
82
|
-
amount: string;
|
|
83
83
|
feeAmount: string;
|
|
84
84
|
netAmount: string;
|
|
85
85
|
payerWalletAddress: string | null;
|
|
@@ -94,16 +94,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
94
94
|
expiresAt: string;
|
|
95
95
|
}, {
|
|
96
96
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
97
|
-
|
|
97
|
+
amount: string;
|
|
98
|
+
currency: "USDC" | "EURC";
|
|
99
|
+
customerId: string | null;
|
|
98
100
|
merchantId: string;
|
|
99
|
-
createdAt: string;
|
|
100
101
|
description: string | null;
|
|
101
|
-
|
|
102
|
+
id: string;
|
|
103
|
+
createdAt: string;
|
|
102
104
|
updatedAt: string;
|
|
103
105
|
chainMerchantId: string | null;
|
|
104
106
|
tokenAddress: string | null;
|
|
105
|
-
customerId: string | null;
|
|
106
|
-
amount: string;
|
|
107
107
|
feeAmount: string;
|
|
108
108
|
netAmount: string;
|
|
109
109
|
payerWalletAddress: string | null;
|
|
@@ -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>;
|
|
@@ -146,29 +146,29 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
146
146
|
supportedSourceChains: z.ZodOptional<z.ZodArray<z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>, "many">>;
|
|
147
147
|
metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
currency: "USDC" | "EURC";
|
|
150
149
|
amount: string;
|
|
150
|
+
currency: "USDC" | "EURC";
|
|
151
151
|
expiresInMinutes: number;
|
|
152
152
|
description?: string | undefined;
|
|
153
153
|
successUrl?: string | undefined;
|
|
154
154
|
cancelUrl?: string | undefined;
|
|
155
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
|
-
currency: "USDC" | "EURC";
|
|
164
163
|
amount: string;
|
|
164
|
+
currency: "USDC" | "EURC";
|
|
165
165
|
description?: string | undefined;
|
|
166
166
|
successUrl?: string | undefined;
|
|
167
167
|
cancelUrl?: string | undefined;
|
|
168
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;
|
|
@@ -70,16 +70,16 @@ 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
|
-
|
|
73
|
+
amount: string;
|
|
74
|
+
currency: "USDC" | "EURC";
|
|
75
|
+
customerId: string | null;
|
|
74
76
|
merchantId: string;
|
|
75
|
-
createdAt: string;
|
|
76
77
|
description: string | null;
|
|
77
|
-
|
|
78
|
+
id: string;
|
|
79
|
+
createdAt: string;
|
|
78
80
|
updatedAt: string;
|
|
79
81
|
chainMerchantId: string | null;
|
|
80
82
|
tokenAddress: string | null;
|
|
81
|
-
customerId: string | null;
|
|
82
|
-
amount: string;
|
|
83
83
|
feeAmount: string;
|
|
84
84
|
netAmount: string;
|
|
85
85
|
payerWalletAddress: string | null;
|
|
@@ -94,16 +94,16 @@ declare const paymentSessionSchema: z.ZodObject<{
|
|
|
94
94
|
expiresAt: string;
|
|
95
95
|
}, {
|
|
96
96
|
status: "created" | "awaiting_payment" | "submitted" | "confirmed" | "failed" | "expired" | "cancelled";
|
|
97
|
-
|
|
97
|
+
amount: string;
|
|
98
|
+
currency: "USDC" | "EURC";
|
|
99
|
+
customerId: string | null;
|
|
98
100
|
merchantId: string;
|
|
99
|
-
createdAt: string;
|
|
100
101
|
description: string | null;
|
|
101
|
-
|
|
102
|
+
id: string;
|
|
103
|
+
createdAt: string;
|
|
102
104
|
updatedAt: string;
|
|
103
105
|
chainMerchantId: string | null;
|
|
104
106
|
tokenAddress: string | null;
|
|
105
|
-
customerId: string | null;
|
|
106
|
-
amount: string;
|
|
107
107
|
feeAmount: string;
|
|
108
108
|
netAmount: string;
|
|
109
109
|
payerWalletAddress: string | null;
|
|
@@ -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>;
|
|
@@ -146,29 +146,29 @@ declare const createPaymentSessionInputSchema: z.ZodObject<{
|
|
|
146
146
|
supportedSourceChains: z.ZodOptional<z.ZodArray<z.ZodEnum<["arc", "ethereum", "base", "polygon", "arbitrum", "optimism", "avalanche", "solana"]>, "many">>;
|
|
147
147
|
metadata: z.ZodOptional<z.ZodDefault<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>, Record<string, string | number | boolean | null>, Record<string, string | number | boolean | null>>>>;
|
|
148
148
|
}, "strip", z.ZodTypeAny, {
|
|
149
|
-
currency: "USDC" | "EURC";
|
|
150
149
|
amount: string;
|
|
150
|
+
currency: "USDC" | "EURC";
|
|
151
151
|
expiresInMinutes: number;
|
|
152
152
|
description?: string | undefined;
|
|
153
153
|
successUrl?: string | undefined;
|
|
154
154
|
cancelUrl?: string | undefined;
|
|
155
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
|
-
currency: "USDC" | "EURC";
|
|
164
163
|
amount: string;
|
|
164
|
+
currency: "USDC" | "EURC";
|
|
165
165
|
description?: string | undefined;
|
|
166
166
|
successUrl?: string | undefined;
|
|
167
167
|
cancelUrl?: string | undefined;
|
|
168
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;
|
package/dist/payment-sessions.js
CHANGED
|
@@ -24,7 +24,7 @@ var metadataSchema = z.record(
|
|
|
24
24
|
z.enum(["test", "live"]);
|
|
25
25
|
var paymentCurrencySchema = z.enum(["USDC", "EURC"]);
|
|
26
26
|
z.enum(["USDC", "EURC", "USYC"]);
|
|
27
|
-
z.enum(["free", "
|
|
27
|
+
z.enum(["free", "starter", "growth", "enterprise"]);
|
|
28
28
|
z.enum(["testnet", "mainnet"]);
|
|
29
29
|
|
|
30
30
|
// src/payment-sessions.ts
|