@strimz/shared-types 0.1.1 → 0.2.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 (58) hide show
  1. package/dist/api-keys.cjs +6 -1
  2. package/dist/api-keys.cjs.map +1 -1
  3. package/dist/api-keys.d.cts +12 -12
  4. package/dist/api-keys.d.ts +12 -12
  5. package/dist/api-keys.js +6 -1
  6. package/dist/api-keys.js.map +1 -1
  7. package/dist/events.cjs +21 -3
  8. package/dist/events.cjs.map +1 -1
  9. package/dist/events.d.cts +12 -12
  10. package/dist/events.d.ts +12 -12
  11. package/dist/events.js +21 -3
  12. package/dist/events.js.map +1 -1
  13. package/dist/index.cjs +181 -4
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +295 -10
  16. package/dist/index.d.ts +295 -10
  17. package/dist/index.js +160 -5
  18. package/dist/index.js.map +1 -1
  19. package/dist/merchants.cjs +59 -1
  20. package/dist/merchants.cjs.map +1 -1
  21. package/dist/merchants.d.cts +171 -1
  22. package/dist/merchants.d.ts +171 -1
  23. package/dist/merchants.js +55 -2
  24. package/dist/merchants.js.map +1 -1
  25. package/dist/payment-sessions.cjs +6 -2
  26. package/dist/payment-sessions.cjs.map +1 -1
  27. package/dist/payment-sessions.d.cts +19 -3
  28. package/dist/payment-sessions.d.ts +19 -3
  29. package/dist/payment-sessions.js +6 -3
  30. package/dist/payment-sessions.js.map +1 -1
  31. package/dist/refunds.cjs +12 -0
  32. package/dist/refunds.cjs.map +1 -1
  33. package/dist/refunds.d.cts +134 -1
  34. package/dist/refunds.d.ts +134 -1
  35. package/dist/refunds.js +11 -1
  36. package/dist/refunds.js.map +1 -1
  37. package/dist/storefronts.cjs +14 -0
  38. package/dist/storefronts.cjs.map +1 -1
  39. package/dist/storefronts.d.cts +37 -1
  40. package/dist/storefronts.d.ts +37 -1
  41. package/dist/storefronts.js +13 -1
  42. package/dist/storefronts.js.map +1 -1
  43. package/dist/webhooks.cjs +6 -0
  44. package/dist/webhooks.cjs.map +1 -1
  45. package/dist/webhooks.d.cts +60 -1
  46. package/dist/webhooks.d.ts +60 -1
  47. package/dist/webhooks.js +6 -1
  48. package/dist/webhooks.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/api-keys.ts +5 -0
  51. package/src/contact.ts +26 -0
  52. package/src/index.ts +2 -0
  53. package/src/merchants.ts +84 -0
  54. package/src/notifications.ts +88 -0
  55. package/src/payment-sessions.ts +24 -2
  56. package/src/refunds.ts +19 -0
  57. package/src/storefronts.ts +24 -0
  58. package/src/webhooks.ts +12 -0
@@ -20,6 +20,8 @@ declare const merchantSchema: z.ZodObject<{
20
20
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
21
21
  status: z.ZodEnum<["active", "suspended", "closed"]>;
22
22
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
23
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
24
+ onboardingCompleted: z.ZodBoolean;
23
25
  defaultCurrency: z.ZodEnum<["USDC", "EURC"]>;
24
26
  countryCode: z.ZodNullable<z.ZodString>;
25
27
  websiteUrl: z.ZodNullable<z.ZodString>;
@@ -32,6 +34,7 @@ declare const merchantSchema: z.ZodObject<{
32
34
  status: "active" | "suspended" | "closed";
33
35
  id: string;
34
36
  createdAt: string;
37
+ walletAddress: string | null;
35
38
  email: string;
36
39
  metadata: Record<string, string | number | boolean | null>;
37
40
  updatedAt: string;
@@ -39,6 +42,7 @@ declare const merchantSchema: z.ZodObject<{
39
42
  businessName: string;
40
43
  tier: "free" | "growth" | "business" | "enterprise";
41
44
  payoutAddress: string | null;
45
+ onboardingCompleted: boolean;
42
46
  defaultCurrency: "USDC" | "EURC";
43
47
  countryCode: string | null;
44
48
  websiteUrl: string | null;
@@ -48,12 +52,14 @@ declare const merchantSchema: z.ZodObject<{
48
52
  status: "active" | "suspended" | "closed";
49
53
  id: string;
50
54
  createdAt: string;
55
+ walletAddress: string | null;
51
56
  email: string;
52
57
  updatedAt: string;
53
58
  onchainMerchantId: number | null;
54
59
  businessName: string;
55
60
  tier: "free" | "growth" | "business" | "enterprise";
56
61
  payoutAddress: string | null;
62
+ onboardingCompleted: boolean;
57
63
  defaultCurrency: "USDC" | "EURC";
58
64
  countryCode: string | null;
59
65
  websiteUrl: string | null;
@@ -82,6 +88,24 @@ declare const createMerchantInputSchema: z.ZodObject<{
82
88
  websiteUrl?: string | undefined;
83
89
  }>;
84
90
  type CreateMerchantInput = z.infer<typeof createMerchantInputSchema>;
91
+ /**
92
+ * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.
93
+ * Both default to true. Welcome, refunds, and admin broadcasts always send.
94
+ */
95
+ declare const merchantEmailPrefsSchema: z.ZodObject<{
96
+ /** "You received X USDC" one-off payment notifications. */
97
+ paymentReceived: z.ZodBoolean;
98
+ /** "You were paid X for subscription Y" per-charge notifications. */
99
+ subscriptionCharged: z.ZodBoolean;
100
+ }, "strip", z.ZodTypeAny, {
101
+ paymentReceived: boolean;
102
+ subscriptionCharged: boolean;
103
+ }, {
104
+ paymentReceived: boolean;
105
+ subscriptionCharged: boolean;
106
+ }>;
107
+ type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>;
108
+ declare const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs;
85
109
  declare const updateMerchantInputSchema: z.ZodObject<{
86
110
  businessName: z.ZodOptional<z.ZodString>;
87
111
  payoutAddress: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -90,6 +114,16 @@ declare const updateMerchantInputSchema: z.ZodObject<{
90
114
  logoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
115
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
116
  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>>>>;
117
+ emailPrefs: z.ZodOptional<z.ZodObject<{
118
+ paymentReceived: z.ZodOptional<z.ZodBoolean>;
119
+ subscriptionCharged: z.ZodOptional<z.ZodBoolean>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ paymentReceived?: boolean | undefined;
122
+ subscriptionCharged?: boolean | undefined;
123
+ }, {
124
+ paymentReceived?: boolean | undefined;
125
+ subscriptionCharged?: boolean | undefined;
126
+ }>>;
93
127
  }, "strip", z.ZodTypeAny, {
94
128
  metadata?: Record<string, string | number | boolean | null> | undefined;
95
129
  businessName?: string | undefined;
@@ -98,6 +132,10 @@ declare const updateMerchantInputSchema: z.ZodObject<{
98
132
  countryCode?: string | null | undefined;
99
133
  websiteUrl?: string | null | undefined;
100
134
  logoUrl?: string | null | undefined;
135
+ emailPrefs?: {
136
+ paymentReceived?: boolean | undefined;
137
+ subscriptionCharged?: boolean | undefined;
138
+ } | undefined;
101
139
  }, {
102
140
  metadata?: Record<string, string | number | boolean | null> | undefined;
103
141
  businessName?: string | undefined;
@@ -106,6 +144,10 @@ declare const updateMerchantInputSchema: z.ZodObject<{
106
144
  countryCode?: string | null | undefined;
107
145
  websiteUrl?: string | null | undefined;
108
146
  logoUrl?: string | null | undefined;
147
+ emailPrefs?: {
148
+ paymentReceived?: boolean | undefined;
149
+ subscriptionCharged?: boolean | undefined;
150
+ } | undefined;
109
151
  }>;
110
152
  type UpdateMerchantInput = z.infer<typeof updateMerchantInputSchema>;
111
153
  declare const changeTierInputSchema: z.ZodObject<{
@@ -116,6 +158,124 @@ declare const changeTierInputSchema: z.ZodObject<{
116
158
  tier: "free" | "growth" | "business" | "enterprise";
117
159
  }>;
118
160
  type ChangeTierInput = z.infer<typeof changeTierInputSchema>;
161
+ /**
162
+ * Self-attested onboarding form the dashboard collects after a
163
+ * merchant first logs in via Privy. On success the API stamps
164
+ * `onboardingCompleted: true` on the row, and the dashboard exits
165
+ * the wizard. Shared here so the API's DTO and the web client's
166
+ * hook can enforce the same shape.
167
+ */
168
+ declare const onboardMerchantInputSchema: z.ZodObject<{
169
+ businessName: z.ZodString;
170
+ businessSector: z.ZodString;
171
+ countryCode: z.ZodString;
172
+ websiteUrl: z.ZodOptional<z.ZodString>;
173
+ logoUrl: z.ZodOptional<z.ZodString>;
174
+ phone: z.ZodOptional<z.ZodString>;
175
+ payoutAddress: z.ZodEffects<z.ZodString, string, string>;
176
+ defaultCurrency: z.ZodOptional<z.ZodEnum<["USDC", "EURC"]>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ businessName: string;
179
+ payoutAddress: string;
180
+ countryCode: string;
181
+ businessSector: string;
182
+ defaultCurrency?: "USDC" | "EURC" | undefined;
183
+ websiteUrl?: string | undefined;
184
+ logoUrl?: string | undefined;
185
+ phone?: string | undefined;
186
+ }, {
187
+ businessName: string;
188
+ payoutAddress: string;
189
+ countryCode: string;
190
+ businessSector: string;
191
+ defaultCurrency?: "USDC" | "EURC" | undefined;
192
+ websiteUrl?: string | undefined;
193
+ logoUrl?: string | undefined;
194
+ phone?: string | undefined;
195
+ }>;
196
+ type OnboardMerchantInput = z.infer<typeof onboardMerchantInputSchema>;
197
+ declare const merchantPublicBrandSchema: z.ZodObject<{
198
+ id: z.ZodString;
199
+ businessName: z.ZodString;
200
+ logoUrl: z.ZodNullable<z.ZodString>;
201
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ id: string;
204
+ walletAddress: string | null;
205
+ businessName: string;
206
+ logoUrl: string | null;
207
+ }, {
208
+ id: string;
209
+ walletAddress: string | null;
210
+ businessName: string;
211
+ logoUrl: string | null;
212
+ }>;
213
+ type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
214
+ /**
215
+ * On-chain balance view for the withdraw page. Strimz is
216
+ * non-custodial: payments settle directly into the merchant's
217
+ * `payoutAddress`, and "withdrawal" means the merchant transferring
218
+ * out with their own wallet. This shape reports current on-chain
219
+ * state so the dashboard renders live balances + decides whether to
220
+ * offer the signing UI.
221
+ */
222
+ declare const merchantBalanceSchema: z.ZodObject<{
223
+ /** Payout wallet, checksummed; null when the merchant hasn't set one. */
224
+ payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
225
+ /** Privy embedded wallet, checksummed if resolvable. */
226
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
227
+ /**
228
+ * True when `payoutAddress === walletAddress`, i.e. the merchant
229
+ * can sign a transfer from the dashboard via Privy. False for
230
+ * merchants using an external wallet as payout — the UI falls back
231
+ * to "copy the address, transfer with your wallet."
232
+ */
233
+ canSignFromDashboard: z.ZodBoolean;
234
+ balances: z.ZodArray<z.ZodObject<{
235
+ currency: z.ZodEnum<["USDC", "EURC"]>;
236
+ contractAddress: z.ZodEffects<z.ZodString, string, string>;
237
+ /** Base-6 integer as string. */
238
+ raw: z.ZodString;
239
+ /** Human-formatted, e.g. `1234.56`. */
240
+ formatted: z.ZodString;
241
+ decimals: z.ZodNumber;
242
+ }, "strip", z.ZodTypeAny, {
243
+ currency: "USDC" | "EURC";
244
+ contractAddress: string;
245
+ raw: string;
246
+ formatted: string;
247
+ decimals: number;
248
+ }, {
249
+ currency: "USDC" | "EURC";
250
+ contractAddress: string;
251
+ raw: string;
252
+ formatted: string;
253
+ decimals: number;
254
+ }>, "many">;
255
+ }, "strip", z.ZodTypeAny, {
256
+ walletAddress: string | null;
257
+ payoutAddress: string | null;
258
+ canSignFromDashboard: boolean;
259
+ balances: {
260
+ currency: "USDC" | "EURC";
261
+ contractAddress: string;
262
+ raw: string;
263
+ formatted: string;
264
+ decimals: number;
265
+ }[];
266
+ }, {
267
+ walletAddress: string | null;
268
+ payoutAddress: string | null;
269
+ canSignFromDashboard: boolean;
270
+ balances: {
271
+ currency: "USDC" | "EURC";
272
+ contractAddress: string;
273
+ raw: string;
274
+ formatted: string;
275
+ decimals: number;
276
+ }[];
277
+ }>;
278
+ type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>;
119
279
  declare const merchantMemberSchema: z.ZodObject<{
120
280
  id: z.ZodString;
121
281
  merchantId: z.ZodString;
@@ -172,6 +332,8 @@ declare const loginOutputSchema: z.ZodObject<{
172
332
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
173
333
  status: z.ZodEnum<["active", "suspended", "closed"]>;
174
334
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
335
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
336
+ onboardingCompleted: z.ZodBoolean;
175
337
  defaultCurrency: z.ZodEnum<["USDC", "EURC"]>;
176
338
  countryCode: z.ZodNullable<z.ZodString>;
177
339
  websiteUrl: z.ZodNullable<z.ZodString>;
@@ -184,6 +346,7 @@ declare const loginOutputSchema: z.ZodObject<{
184
346
  status: "active" | "suspended" | "closed";
185
347
  id: string;
186
348
  createdAt: string;
349
+ walletAddress: string | null;
187
350
  email: string;
188
351
  metadata: Record<string, string | number | boolean | null>;
189
352
  updatedAt: string;
@@ -191,6 +354,7 @@ declare const loginOutputSchema: z.ZodObject<{
191
354
  businessName: string;
192
355
  tier: "free" | "growth" | "business" | "enterprise";
193
356
  payoutAddress: string | null;
357
+ onboardingCompleted: boolean;
194
358
  defaultCurrency: "USDC" | "EURC";
195
359
  countryCode: string | null;
196
360
  websiteUrl: string | null;
@@ -200,12 +364,14 @@ declare const loginOutputSchema: z.ZodObject<{
200
364
  status: "active" | "suspended" | "closed";
201
365
  id: string;
202
366
  createdAt: string;
367
+ walletAddress: string | null;
203
368
  email: string;
204
369
  updatedAt: string;
205
370
  onchainMerchantId: number | null;
206
371
  businessName: string;
207
372
  tier: "free" | "growth" | "business" | "enterprise";
208
373
  payoutAddress: string | null;
374
+ onboardingCompleted: boolean;
209
375
  defaultCurrency: "USDC" | "EURC";
210
376
  countryCode: string | null;
211
377
  websiteUrl: string | null;
@@ -220,6 +386,7 @@ declare const loginOutputSchema: z.ZodObject<{
220
386
  status: "active" | "suspended" | "closed";
221
387
  id: string;
222
388
  createdAt: string;
389
+ walletAddress: string | null;
223
390
  email: string;
224
391
  metadata: Record<string, string | number | boolean | null>;
225
392
  updatedAt: string;
@@ -227,6 +394,7 @@ declare const loginOutputSchema: z.ZodObject<{
227
394
  businessName: string;
228
395
  tier: "free" | "growth" | "business" | "enterprise";
229
396
  payoutAddress: string | null;
397
+ onboardingCompleted: boolean;
230
398
  defaultCurrency: "USDC" | "EURC";
231
399
  countryCode: string | null;
232
400
  websiteUrl: string | null;
@@ -240,12 +408,14 @@ declare const loginOutputSchema: z.ZodObject<{
240
408
  status: "active" | "suspended" | "closed";
241
409
  id: string;
242
410
  createdAt: string;
411
+ walletAddress: string | null;
243
412
  email: string;
244
413
  updatedAt: string;
245
414
  onchainMerchantId: number | null;
246
415
  businessName: string;
247
416
  tier: "free" | "growth" | "business" | "enterprise";
248
417
  payoutAddress: string | null;
418
+ onboardingCompleted: boolean;
249
419
  defaultCurrency: "USDC" | "EURC";
250
420
  countryCode: string | null;
251
421
  websiteUrl: string | null;
@@ -256,4 +426,4 @@ declare const loginOutputSchema: z.ZodObject<{
256
426
  }>;
257
427
  type LoginOutput = z.infer<typeof loginOutputSchema>;
258
428
 
259
- export { type ChangeTierInput, type CreateMerchantInput, type InviteMemberInput, type LoginInput, type LoginOutput, type Merchant, type MerchantMember, type MerchantRole, type MerchantStatus, type UpdateMerchantInput, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantMemberSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, updateMerchantInputSchema };
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 };
@@ -20,6 +20,8 @@ declare const merchantSchema: z.ZodObject<{
20
20
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
21
21
  status: z.ZodEnum<["active", "suspended", "closed"]>;
22
22
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
23
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
24
+ onboardingCompleted: z.ZodBoolean;
23
25
  defaultCurrency: z.ZodEnum<["USDC", "EURC"]>;
24
26
  countryCode: z.ZodNullable<z.ZodString>;
25
27
  websiteUrl: z.ZodNullable<z.ZodString>;
@@ -32,6 +34,7 @@ declare const merchantSchema: z.ZodObject<{
32
34
  status: "active" | "suspended" | "closed";
33
35
  id: string;
34
36
  createdAt: string;
37
+ walletAddress: string | null;
35
38
  email: string;
36
39
  metadata: Record<string, string | number | boolean | null>;
37
40
  updatedAt: string;
@@ -39,6 +42,7 @@ declare const merchantSchema: z.ZodObject<{
39
42
  businessName: string;
40
43
  tier: "free" | "growth" | "business" | "enterprise";
41
44
  payoutAddress: string | null;
45
+ onboardingCompleted: boolean;
42
46
  defaultCurrency: "USDC" | "EURC";
43
47
  countryCode: string | null;
44
48
  websiteUrl: string | null;
@@ -48,12 +52,14 @@ declare const merchantSchema: z.ZodObject<{
48
52
  status: "active" | "suspended" | "closed";
49
53
  id: string;
50
54
  createdAt: string;
55
+ walletAddress: string | null;
51
56
  email: string;
52
57
  updatedAt: string;
53
58
  onchainMerchantId: number | null;
54
59
  businessName: string;
55
60
  tier: "free" | "growth" | "business" | "enterprise";
56
61
  payoutAddress: string | null;
62
+ onboardingCompleted: boolean;
57
63
  defaultCurrency: "USDC" | "EURC";
58
64
  countryCode: string | null;
59
65
  websiteUrl: string | null;
@@ -82,6 +88,24 @@ declare const createMerchantInputSchema: z.ZodObject<{
82
88
  websiteUrl?: string | undefined;
83
89
  }>;
84
90
  type CreateMerchantInput = z.infer<typeof createMerchantInputSchema>;
91
+ /**
92
+ * Merchant email opt-outs, persisted at `Merchant.metadata.emailPrefs`.
93
+ * Both default to true. Welcome, refunds, and admin broadcasts always send.
94
+ */
95
+ declare const merchantEmailPrefsSchema: z.ZodObject<{
96
+ /** "You received X USDC" one-off payment notifications. */
97
+ paymentReceived: z.ZodBoolean;
98
+ /** "You were paid X for subscription Y" per-charge notifications. */
99
+ subscriptionCharged: z.ZodBoolean;
100
+ }, "strip", z.ZodTypeAny, {
101
+ paymentReceived: boolean;
102
+ subscriptionCharged: boolean;
103
+ }, {
104
+ paymentReceived: boolean;
105
+ subscriptionCharged: boolean;
106
+ }>;
107
+ type MerchantEmailPrefs = z.infer<typeof merchantEmailPrefsSchema>;
108
+ declare const DEFAULT_MERCHANT_EMAIL_PREFS: MerchantEmailPrefs;
85
109
  declare const updateMerchantInputSchema: z.ZodObject<{
86
110
  businessName: z.ZodOptional<z.ZodString>;
87
111
  payoutAddress: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
@@ -90,6 +114,16 @@ declare const updateMerchantInputSchema: z.ZodObject<{
90
114
  logoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
115
  countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
116
  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>>>>;
117
+ emailPrefs: z.ZodOptional<z.ZodObject<{
118
+ paymentReceived: z.ZodOptional<z.ZodBoolean>;
119
+ subscriptionCharged: z.ZodOptional<z.ZodBoolean>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ paymentReceived?: boolean | undefined;
122
+ subscriptionCharged?: boolean | undefined;
123
+ }, {
124
+ paymentReceived?: boolean | undefined;
125
+ subscriptionCharged?: boolean | undefined;
126
+ }>>;
93
127
  }, "strip", z.ZodTypeAny, {
94
128
  metadata?: Record<string, string | number | boolean | null> | undefined;
95
129
  businessName?: string | undefined;
@@ -98,6 +132,10 @@ declare const updateMerchantInputSchema: z.ZodObject<{
98
132
  countryCode?: string | null | undefined;
99
133
  websiteUrl?: string | null | undefined;
100
134
  logoUrl?: string | null | undefined;
135
+ emailPrefs?: {
136
+ paymentReceived?: boolean | undefined;
137
+ subscriptionCharged?: boolean | undefined;
138
+ } | undefined;
101
139
  }, {
102
140
  metadata?: Record<string, string | number | boolean | null> | undefined;
103
141
  businessName?: string | undefined;
@@ -106,6 +144,10 @@ declare const updateMerchantInputSchema: z.ZodObject<{
106
144
  countryCode?: string | null | undefined;
107
145
  websiteUrl?: string | null | undefined;
108
146
  logoUrl?: string | null | undefined;
147
+ emailPrefs?: {
148
+ paymentReceived?: boolean | undefined;
149
+ subscriptionCharged?: boolean | undefined;
150
+ } | undefined;
109
151
  }>;
110
152
  type UpdateMerchantInput = z.infer<typeof updateMerchantInputSchema>;
111
153
  declare const changeTierInputSchema: z.ZodObject<{
@@ -116,6 +158,124 @@ declare const changeTierInputSchema: z.ZodObject<{
116
158
  tier: "free" | "growth" | "business" | "enterprise";
117
159
  }>;
118
160
  type ChangeTierInput = z.infer<typeof changeTierInputSchema>;
161
+ /**
162
+ * Self-attested onboarding form the dashboard collects after a
163
+ * merchant first logs in via Privy. On success the API stamps
164
+ * `onboardingCompleted: true` on the row, and the dashboard exits
165
+ * the wizard. Shared here so the API's DTO and the web client's
166
+ * hook can enforce the same shape.
167
+ */
168
+ declare const onboardMerchantInputSchema: z.ZodObject<{
169
+ businessName: z.ZodString;
170
+ businessSector: z.ZodString;
171
+ countryCode: z.ZodString;
172
+ websiteUrl: z.ZodOptional<z.ZodString>;
173
+ logoUrl: z.ZodOptional<z.ZodString>;
174
+ phone: z.ZodOptional<z.ZodString>;
175
+ payoutAddress: z.ZodEffects<z.ZodString, string, string>;
176
+ defaultCurrency: z.ZodOptional<z.ZodEnum<["USDC", "EURC"]>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ businessName: string;
179
+ payoutAddress: string;
180
+ countryCode: string;
181
+ businessSector: string;
182
+ defaultCurrency?: "USDC" | "EURC" | undefined;
183
+ websiteUrl?: string | undefined;
184
+ logoUrl?: string | undefined;
185
+ phone?: string | undefined;
186
+ }, {
187
+ businessName: string;
188
+ payoutAddress: string;
189
+ countryCode: string;
190
+ businessSector: string;
191
+ defaultCurrency?: "USDC" | "EURC" | undefined;
192
+ websiteUrl?: string | undefined;
193
+ logoUrl?: string | undefined;
194
+ phone?: string | undefined;
195
+ }>;
196
+ type OnboardMerchantInput = z.infer<typeof onboardMerchantInputSchema>;
197
+ declare const merchantPublicBrandSchema: z.ZodObject<{
198
+ id: z.ZodString;
199
+ businessName: z.ZodString;
200
+ logoUrl: z.ZodNullable<z.ZodString>;
201
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
202
+ }, "strip", z.ZodTypeAny, {
203
+ id: string;
204
+ walletAddress: string | null;
205
+ businessName: string;
206
+ logoUrl: string | null;
207
+ }, {
208
+ id: string;
209
+ walletAddress: string | null;
210
+ businessName: string;
211
+ logoUrl: string | null;
212
+ }>;
213
+ type MerchantPublicBrand = z.infer<typeof merchantPublicBrandSchema>;
214
+ /**
215
+ * On-chain balance view for the withdraw page. Strimz is
216
+ * non-custodial: payments settle directly into the merchant's
217
+ * `payoutAddress`, and "withdrawal" means the merchant transferring
218
+ * out with their own wallet. This shape reports current on-chain
219
+ * state so the dashboard renders live balances + decides whether to
220
+ * offer the signing UI.
221
+ */
222
+ declare const merchantBalanceSchema: z.ZodObject<{
223
+ /** Payout wallet, checksummed; null when the merchant hasn't set one. */
224
+ payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
225
+ /** Privy embedded wallet, checksummed if resolvable. */
226
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
227
+ /**
228
+ * True when `payoutAddress === walletAddress`, i.e. the merchant
229
+ * can sign a transfer from the dashboard via Privy. False for
230
+ * merchants using an external wallet as payout — the UI falls back
231
+ * to "copy the address, transfer with your wallet."
232
+ */
233
+ canSignFromDashboard: z.ZodBoolean;
234
+ balances: z.ZodArray<z.ZodObject<{
235
+ currency: z.ZodEnum<["USDC", "EURC"]>;
236
+ contractAddress: z.ZodEffects<z.ZodString, string, string>;
237
+ /** Base-6 integer as string. */
238
+ raw: z.ZodString;
239
+ /** Human-formatted, e.g. `1234.56`. */
240
+ formatted: z.ZodString;
241
+ decimals: z.ZodNumber;
242
+ }, "strip", z.ZodTypeAny, {
243
+ currency: "USDC" | "EURC";
244
+ contractAddress: string;
245
+ raw: string;
246
+ formatted: string;
247
+ decimals: number;
248
+ }, {
249
+ currency: "USDC" | "EURC";
250
+ contractAddress: string;
251
+ raw: string;
252
+ formatted: string;
253
+ decimals: number;
254
+ }>, "many">;
255
+ }, "strip", z.ZodTypeAny, {
256
+ walletAddress: string | null;
257
+ payoutAddress: string | null;
258
+ canSignFromDashboard: boolean;
259
+ balances: {
260
+ currency: "USDC" | "EURC";
261
+ contractAddress: string;
262
+ raw: string;
263
+ formatted: string;
264
+ decimals: number;
265
+ }[];
266
+ }, {
267
+ walletAddress: string | null;
268
+ payoutAddress: string | null;
269
+ canSignFromDashboard: boolean;
270
+ balances: {
271
+ currency: "USDC" | "EURC";
272
+ contractAddress: string;
273
+ raw: string;
274
+ formatted: string;
275
+ decimals: number;
276
+ }[];
277
+ }>;
278
+ type MerchantBalanceView = z.infer<typeof merchantBalanceSchema>;
119
279
  declare const merchantMemberSchema: z.ZodObject<{
120
280
  id: z.ZodString;
121
281
  merchantId: z.ZodString;
@@ -172,6 +332,8 @@ declare const loginOutputSchema: z.ZodObject<{
172
332
  tier: z.ZodEnum<["free", "growth", "business", "enterprise"]>;
173
333
  status: z.ZodEnum<["active", "suspended", "closed"]>;
174
334
  payoutAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
335
+ walletAddress: z.ZodNullable<z.ZodEffects<z.ZodString, string, string>>;
336
+ onboardingCompleted: z.ZodBoolean;
175
337
  defaultCurrency: z.ZodEnum<["USDC", "EURC"]>;
176
338
  countryCode: z.ZodNullable<z.ZodString>;
177
339
  websiteUrl: z.ZodNullable<z.ZodString>;
@@ -184,6 +346,7 @@ declare const loginOutputSchema: z.ZodObject<{
184
346
  status: "active" | "suspended" | "closed";
185
347
  id: string;
186
348
  createdAt: string;
349
+ walletAddress: string | null;
187
350
  email: string;
188
351
  metadata: Record<string, string | number | boolean | null>;
189
352
  updatedAt: string;
@@ -191,6 +354,7 @@ declare const loginOutputSchema: z.ZodObject<{
191
354
  businessName: string;
192
355
  tier: "free" | "growth" | "business" | "enterprise";
193
356
  payoutAddress: string | null;
357
+ onboardingCompleted: boolean;
194
358
  defaultCurrency: "USDC" | "EURC";
195
359
  countryCode: string | null;
196
360
  websiteUrl: string | null;
@@ -200,12 +364,14 @@ declare const loginOutputSchema: z.ZodObject<{
200
364
  status: "active" | "suspended" | "closed";
201
365
  id: string;
202
366
  createdAt: string;
367
+ walletAddress: string | null;
203
368
  email: string;
204
369
  updatedAt: string;
205
370
  onchainMerchantId: number | null;
206
371
  businessName: string;
207
372
  tier: "free" | "growth" | "business" | "enterprise";
208
373
  payoutAddress: string | null;
374
+ onboardingCompleted: boolean;
209
375
  defaultCurrency: "USDC" | "EURC";
210
376
  countryCode: string | null;
211
377
  websiteUrl: string | null;
@@ -220,6 +386,7 @@ declare const loginOutputSchema: z.ZodObject<{
220
386
  status: "active" | "suspended" | "closed";
221
387
  id: string;
222
388
  createdAt: string;
389
+ walletAddress: string | null;
223
390
  email: string;
224
391
  metadata: Record<string, string | number | boolean | null>;
225
392
  updatedAt: string;
@@ -227,6 +394,7 @@ declare const loginOutputSchema: z.ZodObject<{
227
394
  businessName: string;
228
395
  tier: "free" | "growth" | "business" | "enterprise";
229
396
  payoutAddress: string | null;
397
+ onboardingCompleted: boolean;
230
398
  defaultCurrency: "USDC" | "EURC";
231
399
  countryCode: string | null;
232
400
  websiteUrl: string | null;
@@ -240,12 +408,14 @@ declare const loginOutputSchema: z.ZodObject<{
240
408
  status: "active" | "suspended" | "closed";
241
409
  id: string;
242
410
  createdAt: string;
411
+ walletAddress: string | null;
243
412
  email: string;
244
413
  updatedAt: string;
245
414
  onchainMerchantId: number | null;
246
415
  businessName: string;
247
416
  tier: "free" | "growth" | "business" | "enterprise";
248
417
  payoutAddress: string | null;
418
+ onboardingCompleted: boolean;
249
419
  defaultCurrency: "USDC" | "EURC";
250
420
  countryCode: string | null;
251
421
  websiteUrl: string | null;
@@ -256,4 +426,4 @@ declare const loginOutputSchema: z.ZodObject<{
256
426
  }>;
257
427
  type LoginOutput = z.infer<typeof loginOutputSchema>;
258
428
 
259
- export { type ChangeTierInput, type CreateMerchantInput, type InviteMemberInput, type LoginInput, type LoginOutput, type Merchant, type MerchantMember, type MerchantRole, type MerchantStatus, type UpdateMerchantInput, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantMemberSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, updateMerchantInputSchema };
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 };
package/dist/merchants.js CHANGED
@@ -38,6 +38,8 @@ var merchantSchema = z.object({
38
38
  tier: merchantTierSchema,
39
39
  status: merchantStatusSchema,
40
40
  payoutAddress: evmAddressSchema.nullable(),
41
+ walletAddress: evmAddressSchema.nullable(),
42
+ onboardingCompleted: z.boolean(),
41
43
  defaultCurrency: z.enum(["USDC", "EURC"]),
42
44
  countryCode: z.string().length(2).nullable(),
43
45
  websiteUrl: z.string().url().nullable(),
@@ -54,6 +56,16 @@ var createMerchantInputSchema = z.object({
54
56
  countryCode: z.string().length(2).optional(),
55
57
  websiteUrl: z.string().url().optional()
56
58
  });
59
+ var merchantEmailPrefsSchema = z.object({
60
+ /** "You received X USDC" one-off payment notifications. */
61
+ paymentReceived: z.boolean(),
62
+ /** "You were paid X for subscription Y" per-charge notifications. */
63
+ subscriptionCharged: z.boolean()
64
+ });
65
+ var DEFAULT_MERCHANT_EMAIL_PREFS = {
66
+ paymentReceived: true,
67
+ subscriptionCharged: true
68
+ };
57
69
  var updateMerchantInputSchema = z.object({
58
70
  businessName: z.string().min(2).max(120),
59
71
  payoutAddress: evmAddressSchema,
@@ -61,11 +73,52 @@ var updateMerchantInputSchema = z.object({
61
73
  websiteUrl: z.string().url().nullable(),
62
74
  logoUrl: z.string().url().nullable(),
63
75
  countryCode: z.string().length(2).nullable(),
64
- metadata: metadataSchema
76
+ metadata: metadataSchema,
77
+ emailPrefs: merchantEmailPrefsSchema.partial()
65
78
  }).partial();
66
79
  var changeTierInputSchema = z.object({
67
80
  tier: merchantTierSchema
68
81
  });
82
+ var onboardMerchantInputSchema = z.object({
83
+ businessName: z.string().min(2).max(120),
84
+ businessSector: z.string().min(2).max(80),
85
+ countryCode: z.string().length(2).regex(/^[A-Z]{2}$/, "must be a 2-letter ISO country code"),
86
+ websiteUrl: z.string().url().optional(),
87
+ logoUrl: z.string().url().optional(),
88
+ phone: z.string().min(6).max(20).optional(),
89
+ payoutAddress: evmAddressSchema,
90
+ defaultCurrency: z.enum(["USDC", "EURC"]).optional()
91
+ });
92
+ var merchantPublicBrandSchema = z.object({
93
+ id: idSchema,
94
+ businessName: z.string().min(2).max(120),
95
+ logoUrl: z.string().url().nullable(),
96
+ walletAddress: evmAddressSchema.nullable()
97
+ });
98
+ var merchantBalanceSchema = z.object({
99
+ /** Payout wallet, checksummed; null when the merchant hasn't set one. */
100
+ payoutAddress: evmAddressSchema.nullable(),
101
+ /** Privy embedded wallet, checksummed if resolvable. */
102
+ walletAddress: evmAddressSchema.nullable(),
103
+ /**
104
+ * True when `payoutAddress === walletAddress`, i.e. the merchant
105
+ * can sign a transfer from the dashboard via Privy. False for
106
+ * merchants using an external wallet as payout — the UI falls back
107
+ * to "copy the address, transfer with your wallet."
108
+ */
109
+ canSignFromDashboard: z.boolean(),
110
+ balances: z.array(
111
+ z.object({
112
+ currency: z.enum(["USDC", "EURC"]),
113
+ contractAddress: evmAddressSchema,
114
+ /** Base-6 integer as string. */
115
+ raw: z.string(),
116
+ /** Human-formatted, e.g. `1234.56`. */
117
+ formatted: z.string(),
118
+ decimals: z.number().int().min(0).max(30)
119
+ })
120
+ )
121
+ });
69
122
  var merchantMemberSchema = z.object({
70
123
  id: idSchema,
71
124
  merchantId: idSchema,
@@ -88,6 +141,6 @@ var loginOutputSchema = z.object({
88
141
  merchant: merchantSchema
89
142
  });
90
143
 
91
- export { changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantMemberSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, updateMerchantInputSchema };
144
+ export { DEFAULT_MERCHANT_EMAIL_PREFS, changeTierInputSchema, createMerchantInputSchema, inviteMemberInputSchema, loginInputSchema, loginOutputSchema, merchantBalanceSchema, merchantEmailPrefsSchema, merchantMemberSchema, merchantPublicBrandSchema, merchantRoleSchema, merchantSchema, merchantStatusSchema, onboardMerchantInputSchema, updateMerchantInputSchema };
92
145
  //# sourceMappingURL=merchants.js.map
93
146
  //# sourceMappingURL=merchants.js.map