@frak-labs/core-sdk 1.1.5 → 1.1.6-beta.7400608e

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 (60) hide show
  1. package/cdn/bundle.js +1 -1
  2. package/dist/{actions-DrZ_PIs1.cjs → actions-Cyn4asew.cjs} +1 -1
  3. package/dist/{actions-DrZ_PIs1.cjs.map → actions-Cyn4asew.cjs.map} +1 -1
  4. package/dist/{actions-HG5M8wX7.js → actions-DtPVuk2e.js} +1 -1
  5. package/dist/{actions-HG5M8wX7.js.map → actions-DtPVuk2e.js.map} +1 -1
  6. package/dist/actions.cjs +1 -1
  7. package/dist/actions.d.cts +2 -2
  8. package/dist/actions.d.ts +2 -2
  9. package/dist/actions.js +1 -1
  10. package/dist/bundle.cjs +1 -1
  11. package/dist/bundle.d.cts +5 -4
  12. package/dist/bundle.d.ts +5 -4
  13. package/dist/bundle.js +1 -1
  14. package/dist/getCurrencyAmountKey-DQcwjJiB.js +2 -0
  15. package/dist/getCurrencyAmountKey-DQcwjJiB.js.map +1 -0
  16. package/dist/getCurrencyAmountKey-h2eOiYzv.cjs +2 -0
  17. package/dist/getCurrencyAmountKey-h2eOiYzv.cjs.map +1 -0
  18. package/dist/{index-BysidNLB.d.ts → index-CD-GW6rL.d.ts} +3 -2
  19. package/dist/{index-k1lfbVkl.d.cts → index-D5_EwZ3f.d.cts} +3 -2
  20. package/dist/{index-C1A3I4x1.d.cts → index-DPez7SXh.d.cts} +3 -2
  21. package/dist/{index-BJMazhpm.d.ts → index-DQYipoH_.d.ts} +3 -2
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.d.cts +4 -3
  24. package/dist/index.d.ts +4 -3
  25. package/dist/index.js +1 -1
  26. package/dist/merchantInformation--tLnowAN.d.ts +344 -0
  27. package/dist/merchantInformation-BSuahpjl.d.cts +344 -0
  28. package/dist/{openSso-BWeD0Fb2.d.ts → openSso-CjZ8lAEA.d.ts} +7 -286
  29. package/dist/{openSso-B0igO6Iu.d.cts → openSso-DSXbUP-j.d.cts} +7 -286
  30. package/dist/rewards.cjs +2 -0
  31. package/dist/rewards.cjs.map +1 -0
  32. package/dist/rewards.d.cts +130 -0
  33. package/dist/rewards.d.ts +130 -0
  34. package/dist/rewards.js +2 -0
  35. package/dist/rewards.js.map +1 -0
  36. package/dist/src-B6pI1TcB.js +2 -0
  37. package/dist/src-B6pI1TcB.js.map +1 -0
  38. package/dist/src-BLK9iiAu.cjs +2 -0
  39. package/dist/src-BLK9iiAu.cjs.map +1 -0
  40. package/package.json +14 -2
  41. package/src/actions/getMerchantInformation.test.ts +2 -0
  42. package/src/index.ts +6 -0
  43. package/src/rewards/conditions.test.ts +60 -0
  44. package/src/rewards/conditions.ts +72 -0
  45. package/src/rewards/example.test.ts +92 -0
  46. package/src/rewards/example.ts +57 -0
  47. package/src/rewards/format.test.ts +143 -0
  48. package/src/rewards/format.ts +81 -0
  49. package/src/rewards/index.ts +29 -0
  50. package/src/rewards/select.test.ts +281 -0
  51. package/src/rewards/select.ts +197 -0
  52. package/src/rewards/value.test.ts +89 -0
  53. package/src/rewards/value.ts +73 -0
  54. package/src/types/index.ts +6 -0
  55. package/src/types/resolvedConfig.ts +4 -0
  56. package/src/types/rpc/merchantInformation.ts +107 -7
  57. package/dist/src-DXE40XuK.js +0 -2
  58. package/dist/src-DXE40XuK.js.map +0 -1
  59. package/dist/src-hwLbVkQI.cjs +0 -2
  60. package/dist/src-hwLbVkQI.cjs.map +0 -1
@@ -0,0 +1,344 @@
1
+ import { Address } from "viem";
2
+
3
+ //#region src/types/tracking.d.ts
4
+ type UtmParams = {
5
+ source?: string;
6
+ medium?: string;
7
+ campaign?: string;
8
+ term?: string;
9
+ content?: string;
10
+ };
11
+ /**
12
+ * Attribution parameters appended to outbound sharing URLs.
13
+ *
14
+ * Defaults are derived from the V2 Frak context when available:
15
+ * - `utmSource`: `"frak"`
16
+ * - `utmMedium`: `"referral"`
17
+ * - `utmCampaign`: merchantId (`context.m`)
18
+ * - `via`: `"frak"`
19
+ * - `ref`: clientId (`context.c`)
20
+ *
21
+ * Fields explicitly set here override the defaults. Existing params on the
22
+ * base URL are preserved (gap-fill policy) to respect merchant-provided UTMs.
23
+ */
24
+ type AttributionParams = {
25
+ utmSource?: string;
26
+ utmMedium?: string;
27
+ utmCampaign?: string;
28
+ utmContent?: string;
29
+ utmTerm?: string;
30
+ via?: string;
31
+ ref?: string;
32
+ };
33
+ /**
34
+ * Merchant-level attribution defaults.
35
+ *
36
+ * Same shape as {@link AttributionParams} minus `utmContent`, because
37
+ * `utm_content` describes the specific content/creative being shared and is
38
+ * inherently per-call or per-product (never a merchant-wide default).
39
+ *
40
+ * Used as the shape for both:
41
+ * - `FrakWalletSdkConfig.attribution` (SDK-side compile-time defaults)
42
+ * - Backend merchant-config attribution (dashboard-driven defaults)
43
+ */
44
+ type AttributionDefaults = Omit<AttributionParams, "utmContent">;
45
+ type TrackArrivalParams = {
46
+ /** Sharer wallet address. Accepted in both V1 (legacy) and V2 (authenticated sharer) contexts. */referrerWallet?: Address;
47
+ referrerClientId?: string;
48
+ referrerMerchantId?: string; /** Epoch seconds timestamp from the referral link creation */
49
+ referralTimestamp?: number;
50
+ };
51
+ type TrackArrivalResult = {
52
+ success: boolean;
53
+ identityGroupId?: string;
54
+ referralLinkId?: string;
55
+ error?: string;
56
+ };
57
+ //#endregion
58
+ //#region src/types/config.d.ts
59
+ /**
60
+ * All the currencies available
61
+ * @category Config
62
+ */
63
+ type Currency = "eur" | "usd" | "gbp";
64
+ /**
65
+ * All the languages available
66
+ * @category Config
67
+ */
68
+ type Language = "fr" | "en";
69
+ /**
70
+ * Configuration for the Frak Wallet SDK
71
+ * @category Config
72
+ */
73
+ type FrakWalletSdkConfig = {
74
+ /**
75
+ * The Frak wallet url
76
+ * @defaultValue "https://wallet.frak.id"
77
+ */
78
+ walletUrl?: string;
79
+ /**
80
+ * Some metadata about your implementation of the Frak SDK
81
+ */
82
+ metadata: {
83
+ /**
84
+ * Your application name (will be displayed in a few modals and in SSO)
85
+ */
86
+ name?: string;
87
+ /**
88
+ * Your merchant ID from the Frak dashboard (UUID format)
89
+ * Used for referral tracking and analytics
90
+ * If not provided, will be auto-fetched from the backend using your domain
91
+ */
92
+ merchantId?: string;
93
+ /**
94
+ * Language to display in the modal
95
+ * If undefined, will default to the browser language
96
+ */
97
+ lang?: Language;
98
+ /**
99
+ * The currency to display in the modal
100
+ * @defaultValue `"eur"`
101
+ */
102
+ currency?: Currency;
103
+ /**
104
+ * The logo URL that will be displayed in a few components
105
+ */
106
+ logoUrl?: string;
107
+ /**
108
+ * The homepage link that could be displayed in a few components
109
+ */
110
+ homepageLink?: string;
111
+ };
112
+ /**
113
+ * Some customization for the modal
114
+ */
115
+ customizations?: {
116
+ /**
117
+ * Custom CSS styles to apply to the modals and components
118
+ */
119
+ css?: `${string}.css`;
120
+ /**
121
+ * Custom i18n configuration for the modal
122
+ */
123
+ i18n?: I18nConfig;
124
+ };
125
+ /**
126
+ * The domain name of your application
127
+ * @defaultValue window.location.host
128
+ */
129
+ domain?: string;
130
+ /**
131
+ * Wait for backend config before rendering components.
132
+ * When true (default), components show a spinner until backend config is resolved.
133
+ * When false, components render immediately with SDK static config / HTML attributes.
134
+ * @defaultValue true
135
+ */
136
+ waitForBackendConfig?: boolean;
137
+ /**
138
+ * Default attribution params (UTM / via / ref) appended to outbound
139
+ * sharing URLs. Per-call `displaySharingPage` overrides win, then backend
140
+ * config, then this SDK-level default. `utm_content` is intentionally
141
+ * excluded — it is per-content/per-product, never a merchant-wide default.
142
+ */
143
+ attribution?: AttributionDefaults;
144
+ /**
145
+ * Preload specific UI views inside the listener iframe for better UX.
146
+ * Default: ["sharing"]
147
+ */
148
+ preload?: ListenerPreloadOption[];
149
+ };
150
+ /**
151
+ * Custom i18n configuration for the modal
152
+ * See [i18next json format](https://www.i18next.com/misc/json-format#i18next-json-v4)
153
+ *
154
+ * Available variables
155
+ * - `{{ productName }}` : The name of your website (`metadata.name`)
156
+ * - `{{ productOrigin }}` : The origin url of your website
157
+ * - `{{ estimatedReward }}` : The estimated reward for the user (based on the specific `targetInteraction` you can specify, or the max referrer reward if no target interaction is specified)
158
+ *
159
+ * Context of the translation [see i18n context](https://www.i18next.com/translation-function/context)
160
+ * - For modal display, the key of the final action (`sharing`, `reward`, or undefined)
161
+ * - For embedded wallet display, the key of the logged in action (`sharing` or undefined)
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * // Multi language config
166
+ * const multiI18n = {
167
+ * fr: {
168
+ * "sdk.modal.title": "Titre de modal",
169
+ * "sdk.modal.description": "Description de modal, avec {{ estimatedReward }} de gains possible",
170
+ * },
171
+ * en: "https://example.com/en.json"
172
+ * }
173
+ *
174
+ * // Single language config
175
+ * const singleI18n = {
176
+ * "sdk.modal.title": "Modal title",
177
+ * "sdk.modal.description": "Modal description, with {{ estimatedReward }} of gains possible",
178
+ * }
179
+ * ```
180
+ *
181
+ * @category Config
182
+ */
183
+ type I18nConfig = Record<Language, LocalizedI18nConfig> | LocalizedI18nConfig;
184
+ /**
185
+ * Options for preloading the listener UI
186
+ * @category Config
187
+ */
188
+ type ListenerPreloadOption = "modal" | "sharing";
189
+ /**
190
+ * A localized i18n config (inline objects only — URL-based i18n removed)
191
+ * @category Config
192
+ */
193
+ type LocalizedI18nConfig = {
194
+ [key: string]: string;
195
+ };
196
+ //#endregion
197
+ //#region src/constants/interactionTypes.d.ts
198
+ /**
199
+ * The supported interaction type keys
200
+ *
201
+ * - `referral` - User arrived via a referral link
202
+ * - `create_referral_link` - User created/shared a referral link
203
+ * - `purchase` - User completed a purchase
204
+ * - `custom.${string}` - Custom interaction type defined per campaign
205
+ *
206
+ * @inline
207
+ */
208
+ type InteractionTypeKey = "referral" | "create_referral_link" | "purchase" | `custom.${string}`;
209
+ //#endregion
210
+ //#region src/types/rpc/merchantInformation.d.ts
211
+ /**
212
+ * The type for the amount of tokens
213
+ */
214
+ type TokenAmountType = {
215
+ amount: number;
216
+ eurAmount: number;
217
+ usdAmount: number;
218
+ gbpAmount: number;
219
+ };
220
+ /**
221
+ * A tier definition for tiered rewards — pays either a flat token amount
222
+ * or a percent of the tier field value
223
+ */
224
+ type RewardTier = {
225
+ minValue: number;
226
+ maxValue?: number;
227
+ amount: TokenAmountType;
228
+ } | {
229
+ minValue: number;
230
+ maxValue?: number;
231
+ percent: number;
232
+ };
233
+ /**
234
+ * Estimated reward amount — discriminated union by payout type
235
+ *
236
+ * - `fixed`: A known token amount (with fiat equivalents)
237
+ * - `percentage`: A percent of a purchase field (e.g. 5% of purchase_amount), with optional min/max caps
238
+ * - `tiered`: Amount depends on a field value matching tier brackets
239
+ */
240
+ type EstimatedReward = {
241
+ payoutType: "fixed";
242
+ amount: TokenAmountType;
243
+ } | {
244
+ payoutType: "percentage";
245
+ percent: number;
246
+ percentOf: string;
247
+ maxAmount?: TokenAmountType;
248
+ minAmount?: TokenAmountType;
249
+ } | {
250
+ payoutType: "tiered";
251
+ tierField: string;
252
+ tiers: RewardTier[];
253
+ };
254
+ /**
255
+ * Comparison operators usable in a {@link RuleCondition}.
256
+ * @group RPC Schema
257
+ */
258
+ type ConditionOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | "exists" | "not_exists" | "between";
259
+ /**
260
+ * Dot-path of the rule-evaluation context field a {@link RuleCondition} targets.
261
+ *
262
+ * Only the paths the SDK actually reads are listed (for editor autocompletion);
263
+ * the trailing `string` member keeps the type open to any other path the backend
264
+ * may emit, so it never lies at runtime. Custom interaction data is addressed
265
+ * through `custom.${string}`.
266
+ * @group RPC Schema
267
+ */
268
+ type RuleField = "purchase.amount" | "time.timestamp" | "attribution.referrerIdentityGroupId" | `custom.${string}` | (string & Record<never, never>);
269
+ /**
270
+ * A single leaf rule condition. Compares the value found at {@link RuleField}
271
+ * in the evaluation context against `value` (and `valueTo` for `between`).
272
+ * @group RPC Schema
273
+ */
274
+ type RuleCondition = {
275
+ field: RuleField;
276
+ operator: ConditionOperator;
277
+ value: string | number | boolean | null;
278
+ valueTo?: string | number | boolean | null;
279
+ };
280
+ /**
281
+ * A recursive group of conditions combined through a boolean `logic`.
282
+ * @group RPC Schema
283
+ */
284
+ type ConditionGroup = {
285
+ logic: "all" | "any" | "none";
286
+ conditions: (RuleCondition | ConditionGroup)[];
287
+ };
288
+ /**
289
+ * Campaign gating rules: a flat list of {@link RuleCondition} (implicitly
290
+ * AND-ed) or a nested {@link ConditionGroup} tree. Surfaced raw so integrators
291
+ * can inspect the rules and derive their own display (start date, minimum
292
+ * purchase, …) instead of relying on pre-computed fields.
293
+ * @group RPC Schema
294
+ */
295
+ type RuleConditions = RuleCondition[] | ConditionGroup;
296
+ /**
297
+ * A reward offer exposed by a merchant campaign.
298
+ *
299
+ * Mirrors the backend `EstimatedRewardItem` one-to-one — a static parity
300
+ * assertion on the backend keeps its runtime-validated schema in lockstep with
301
+ * this published contract.
302
+ * @group RPC Schema
303
+ */
304
+ type MerchantReward = {
305
+ /** Reward token address; falls back to the merchant token when omitted. */token?: Address; /** Identifier of the campaign rule this reward originates from. */
306
+ campaignId: string; /** Campaign display name. */
307
+ name: string; /** Interaction that triggers the reward. */
308
+ interactionTypeKey: InteractionTypeKey; /** Reward paid to the referrer, when the campaign defines one. */
309
+ referrer?: EstimatedReward; /** Reward paid to the referee, when the campaign defines one. */
310
+ referee?: EstimatedReward; /** Raw gating rules — inspect to derive start date, minimum purchase, … */
311
+ conditions: RuleConditions; /** Seconds a reward stays locked before settlement. */
312
+ defaultLockupSeconds?: number; /** Days before a pending reward expires. */
313
+ pendingRewardExpirationDays?: number; /** Per-user reward cap for this campaign. */
314
+ maxRewardsPerUser?: number; /** Merchant-wide per-user reward cap across every campaign. */
315
+ merchantMaxRewardsPerUser?: number; /** ISO-8601 campaign end date, or `null` when open-ended. */
316
+ expiresAt?: string | null;
317
+ };
318
+ /**
319
+ * Response of the `frak_getMerchantInformation` RPC method
320
+ * @group RPC Schema
321
+ */
322
+ type GetMerchantInformationReturnType = {
323
+ /**
324
+ * Current merchant id
325
+ */
326
+ id: string;
327
+ /**
328
+ * Some metadata
329
+ */
330
+ onChainMetadata: {
331
+ /**
332
+ * Name of the merchant on-chain
333
+ */
334
+ name: string;
335
+ /**
336
+ * Domain of the merchant on-chain
337
+ */
338
+ domain: string;
339
+ };
340
+ rewards: MerchantReward[];
341
+ };
342
+ //#endregion
343
+ export { UtmParams as S, LocalizedI18nConfig as _, MerchantReward as a, TrackArrivalParams as b, RuleConditions as c, InteractionTypeKey as d, Currency as f, ListenerPreloadOption as g, Language as h, GetMerchantInformationReturnType as i, RuleField as l, I18nConfig as m, ConditionOperator as n, RewardTier as o, FrakWalletSdkConfig as p, EstimatedReward as r, RuleCondition as s, ConditionGroup as t, TokenAmountType as u, AttributionDefaults as v, TrackArrivalResult as x, AttributionParams as y };
344
+ //# sourceMappingURL=merchantInformation-BSuahpjl.d.cts.map
@@ -1,202 +1,9 @@
1
+ import { d as InteractionTypeKey, f as Currency, h as Language, i as GetMerchantInformationReturnType, m as I18nConfig, p as FrakWalletSdkConfig, v as AttributionDefaults, y as AttributionParams } from "./merchantInformation--tLnowAN.js";
1
2
  import { LifecycleMessage, RpcClient } from "@frak-labs/frame-connector";
2
3
  import { OpenPanel } from "@openpanel/web";
3
4
  import { Address, Hex } from "viem";
4
5
  import { SiweMessage } from "viem/siwe";
5
6
 
6
- //#region src/types/tracking.d.ts
7
- type UtmParams = {
8
- source?: string;
9
- medium?: string;
10
- campaign?: string;
11
- term?: string;
12
- content?: string;
13
- };
14
- /**
15
- * Attribution parameters appended to outbound sharing URLs.
16
- *
17
- * Defaults are derived from the V2 Frak context when available:
18
- * - `utmSource`: `"frak"`
19
- * - `utmMedium`: `"referral"`
20
- * - `utmCampaign`: merchantId (`context.m`)
21
- * - `via`: `"frak"`
22
- * - `ref`: clientId (`context.c`)
23
- *
24
- * Fields explicitly set here override the defaults. Existing params on the
25
- * base URL are preserved (gap-fill policy) to respect merchant-provided UTMs.
26
- */
27
- type AttributionParams = {
28
- utmSource?: string;
29
- utmMedium?: string;
30
- utmCampaign?: string;
31
- utmContent?: string;
32
- utmTerm?: string;
33
- via?: string;
34
- ref?: string;
35
- };
36
- /**
37
- * Merchant-level attribution defaults.
38
- *
39
- * Same shape as {@link AttributionParams} minus `utmContent`, because
40
- * `utm_content` describes the specific content/creative being shared and is
41
- * inherently per-call or per-product (never a merchant-wide default).
42
- *
43
- * Used as the shape for both:
44
- * - `FrakWalletSdkConfig.attribution` (SDK-side compile-time defaults)
45
- * - Backend merchant-config attribution (dashboard-driven defaults)
46
- */
47
- type AttributionDefaults = Omit<AttributionParams, "utmContent">;
48
- type TrackArrivalParams = {
49
- /** Sharer wallet address. Accepted in both V1 (legacy) and V2 (authenticated sharer) contexts. */referrerWallet?: Address;
50
- referrerClientId?: string;
51
- referrerMerchantId?: string; /** Epoch seconds timestamp from the referral link creation */
52
- referralTimestamp?: number;
53
- };
54
- type TrackArrivalResult = {
55
- success: boolean;
56
- identityGroupId?: string;
57
- referralLinkId?: string;
58
- error?: string;
59
- };
60
- //#endregion
61
- //#region src/types/config.d.ts
62
- /**
63
- * All the currencies available
64
- * @category Config
65
- */
66
- type Currency = "eur" | "usd" | "gbp";
67
- /**
68
- * All the languages available
69
- * @category Config
70
- */
71
- type Language = "fr" | "en";
72
- /**
73
- * Configuration for the Frak Wallet SDK
74
- * @category Config
75
- */
76
- type FrakWalletSdkConfig = {
77
- /**
78
- * The Frak wallet url
79
- * @defaultValue "https://wallet.frak.id"
80
- */
81
- walletUrl?: string;
82
- /**
83
- * Some metadata about your implementation of the Frak SDK
84
- */
85
- metadata: {
86
- /**
87
- * Your application name (will be displayed in a few modals and in SSO)
88
- */
89
- name?: string;
90
- /**
91
- * Your merchant ID from the Frak dashboard (UUID format)
92
- * Used for referral tracking and analytics
93
- * If not provided, will be auto-fetched from the backend using your domain
94
- */
95
- merchantId?: string;
96
- /**
97
- * Language to display in the modal
98
- * If undefined, will default to the browser language
99
- */
100
- lang?: Language;
101
- /**
102
- * The currency to display in the modal
103
- * @defaultValue `"eur"`
104
- */
105
- currency?: Currency;
106
- /**
107
- * The logo URL that will be displayed in a few components
108
- */
109
- logoUrl?: string;
110
- /**
111
- * The homepage link that could be displayed in a few components
112
- */
113
- homepageLink?: string;
114
- };
115
- /**
116
- * Some customization for the modal
117
- */
118
- customizations?: {
119
- /**
120
- * Custom CSS styles to apply to the modals and components
121
- */
122
- css?: `${string}.css`;
123
- /**
124
- * Custom i18n configuration for the modal
125
- */
126
- i18n?: I18nConfig;
127
- };
128
- /**
129
- * The domain name of your application
130
- * @defaultValue window.location.host
131
- */
132
- domain?: string;
133
- /**
134
- * Wait for backend config before rendering components.
135
- * When true (default), components show a spinner until backend config is resolved.
136
- * When false, components render immediately with SDK static config / HTML attributes.
137
- * @defaultValue true
138
- */
139
- waitForBackendConfig?: boolean;
140
- /**
141
- * Default attribution params (UTM / via / ref) appended to outbound
142
- * sharing URLs. Per-call `displaySharingPage` overrides win, then backend
143
- * config, then this SDK-level default. `utm_content` is intentionally
144
- * excluded — it is per-content/per-product, never a merchant-wide default.
145
- */
146
- attribution?: AttributionDefaults;
147
- /**
148
- * Preload specific UI views inside the listener iframe for better UX.
149
- * Default: ["sharing"]
150
- */
151
- preload?: ListenerPreloadOption[];
152
- };
153
- /**
154
- * Custom i18n configuration for the modal
155
- * See [i18next json format](https://www.i18next.com/misc/json-format#i18next-json-v4)
156
- *
157
- * Available variables
158
- * - `{{ productName }}` : The name of your website (`metadata.name`)
159
- * - `{{ productOrigin }}` : The origin url of your website
160
- * - `{{ estimatedReward }}` : The estimated reward for the user (based on the specific `targetInteraction` you can specify, or the max referrer reward if no target interaction is specified)
161
- *
162
- * Context of the translation [see i18n context](https://www.i18next.com/translation-function/context)
163
- * - For modal display, the key of the final action (`sharing`, `reward`, or undefined)
164
- * - For embedded wallet display, the key of the logged in action (`sharing` or undefined)
165
- *
166
- * @example
167
- * ```ts
168
- * // Multi language config
169
- * const multiI18n = {
170
- * fr: {
171
- * "sdk.modal.title": "Titre de modal",
172
- * "sdk.modal.description": "Description de modal, avec {{ estimatedReward }} de gains possible",
173
- * },
174
- * en: "https://example.com/en.json"
175
- * }
176
- *
177
- * // Single language config
178
- * const singleI18n = {
179
- * "sdk.modal.title": "Modal title",
180
- * "sdk.modal.description": "Modal description, with {{ estimatedReward }} of gains possible",
181
- * }
182
- * ```
183
- *
184
- * @category Config
185
- */
186
- type I18nConfig = Record<Language, LocalizedI18nConfig> | LocalizedI18nConfig;
187
- /**
188
- * Options for preloading the listener UI
189
- * @category Config
190
- */
191
- type ListenerPreloadOption = "modal" | "sharing";
192
- /**
193
- * A localized i18n config (inline objects only — URL-based i18n removed)
194
- * @category Config
195
- */
196
- type LocalizedI18nConfig = {
197
- [key: string]: string;
198
- };
199
- //#endregion
200
7
  //#region src/types/resolvedConfig.d.ts
201
8
  /**
202
9
  * Response from the merchant resolve endpoint
@@ -237,7 +44,8 @@ type ResolvedPlacement = {
237
44
  referrerText?: string;
238
45
  referrerNoRewardText?: string;
239
46
  ctaText?: string;
240
- ctaNoRewardText?: string;
47
+ ctaNoRewardText?: string; /** Custom illustration URL replacing the built-in gift icon. */
48
+ imageUrl?: string;
241
49
  css?: string;
242
50
  };
243
51
  banner?: {
@@ -246,7 +54,8 @@ type ResolvedPlacement = {
246
54
  referralCta?: string;
247
55
  inappTitle?: string;
248
56
  inappDescription?: string;
249
- inappCta?: string;
57
+ inappCta?: string; /** Custom illustration URL replacing the built-in gift icon. */
58
+ imageUrl?: string;
250
59
  css?: string;
251
60
  };
252
61
  };
@@ -404,19 +213,6 @@ type RedirectRequestEvent = {
404
213
  };
405
214
  };
406
215
  //#endregion
407
- //#region src/constants/interactionTypes.d.ts
408
- /**
409
- * The supported interaction type keys
410
- *
411
- * - `referral` - User arrived via a referral link
412
- * - `create_referral_link` - User created/shared a referral link
413
- * - `purchase` - User completed a purchase
414
- * - `custom.${string}` - Custom interaction type defined per campaign
415
- *
416
- * @inline
417
- */
418
- type InteractionTypeKey = "referral" | "create_referral_link" | "purchase" | `custom.${string}`;
419
- //#endregion
420
216
  //#region src/types/rpc/modal/generic.d.ts
421
217
  /**
422
218
  * Represent a generic modal step type
@@ -978,81 +774,6 @@ type SendInteractionParamsType = {
978
774
  idempotencyKey?: string;
979
775
  };
980
776
  //#endregion
981
- //#region src/types/rpc/merchantInformation.d.ts
982
- /**
983
- * The type for the amount of tokens
984
- */
985
- type TokenAmountType = {
986
- amount: number;
987
- eurAmount: number;
988
- usdAmount: number;
989
- gbpAmount: number;
990
- };
991
- /**
992
- * A tier definition for tiered rewards — pays either a flat token amount
993
- * or a percent of the tier field value
994
- */
995
- type RewardTier = {
996
- minValue: number;
997
- maxValue?: number;
998
- amount: TokenAmountType;
999
- } | {
1000
- minValue: number;
1001
- maxValue?: number;
1002
- percent: number;
1003
- };
1004
- /**
1005
- * Estimated reward amount — discriminated union by payout type
1006
- *
1007
- * - `fixed`: A known token amount (with fiat equivalents)
1008
- * - `percentage`: A percent of a purchase field (e.g. 5% of purchase_amount), with optional min/max caps
1009
- * - `tiered`: Amount depends on a field value matching tier brackets
1010
- */
1011
- type EstimatedReward = {
1012
- payoutType: "fixed";
1013
- amount: TokenAmountType;
1014
- } | {
1015
- payoutType: "percentage";
1016
- percent: number;
1017
- percentOf: string;
1018
- maxAmount?: TokenAmountType;
1019
- minAmount?: TokenAmountType;
1020
- } | {
1021
- payoutType: "tiered";
1022
- tierField: string;
1023
- tiers: RewardTier[];
1024
- };
1025
- /**
1026
- * Response of the `frak_getMerchantInformation` RPC method
1027
- * @group RPC Schema
1028
- */
1029
- type GetMerchantInformationReturnType = {
1030
- /**
1031
- * Current merchant id
1032
- */
1033
- id: string;
1034
- /**
1035
- * Some metadata
1036
- */
1037
- onChainMetadata: {
1038
- /**
1039
- * Name of the merchant on-chain
1040
- */
1041
- name: string;
1042
- /**
1043
- * Domain of the merchant on-chain
1044
- */
1045
- domain: string;
1046
- };
1047
- rewards: {
1048
- token?: Address;
1049
- campaignId: string;
1050
- interactionTypeKey: InteractionTypeKey;
1051
- referrer?: EstimatedReward;
1052
- referee?: EstimatedReward;
1053
- }[];
1054
- };
1055
- //#endregion
1056
777
  //#region src/types/rpc/userReferralStatus.d.ts
1057
778
  /**
1058
779
  * User referral status returned by `frak_getUserReferralStatus`.
@@ -1392,5 +1113,5 @@ declare const ssoPopupName = "frak-sso";
1392
1113
  */
1393
1114
  declare function openSso(client: FrakClient, inputArgs: OpenSsoParamsType): Promise<OpenSsoReturnType>;
1394
1115
  //#endregion
1395
- export { SdkResolvedConfig as $, ModalRpcStepsResultType as A, OpenSsoReturnType as B, LoggedInEmbeddedView as C, DisplayModalParamsType as D, SharingPageProduct as E, SiweAuthenticateModalStepType as F, FinalModalStepType as G, PrepareSsoReturnType as H, SiweAuthenticateReturnType as I, IFrameLifecycleEvent as J, ModalStepMetadata as K, SiweAuthenticationParams as L, SendTransactionModalStepType as M, SendTransactionReturnType as N, ModalRpcMetadata as O, SendTransactionTxType as P, ResolvedSdkConfig as Q, LoginModalStepType as R, EmbeddedViewActionSharing as S, DisplaySharingPageResultType as T, SsoMetadata as U, PrepareSsoParamsType as V, FinalActionType as W, MerchantConfigResponse as X, ClientLifecycleEvent as Y, ResolvedPlacement as Z, SendInteractionParamsType as _, FrakContextV1 as a, LocalizedI18nConfig as at, LoggedOutEmbeddedView as b, FrakLifecycleEvent as c, TrackArrivalParams as ct, WalletStatusReturnType as d, Currency as et, UserReferralStatusType as f, TokenAmountType as g, RewardTier as h, FrakContext as i, ListenerPreloadOption as it, ModalStepTypes as j, ModalRpcStepsInput as k, IFrameTransport as l, TrackArrivalResult as lt, GetMerchantInformationReturnType as m, ssoPopupFeatures as n, I18nConfig as nt, FrakContextV2 as o, AttributionDefaults as ot, EstimatedReward as p, InteractionTypeKey as q, ssoPopupName as r, Language as rt, FrakClient as s, AttributionParams as st, openSso as t, FrakWalletSdkConfig as tt, IFrameRpcSchema as u, UtmParams as ut, DisplayEmbeddedWalletParamsType as v, DisplaySharingPageParamsType as w, EmbeddedViewActionReferred as x, DisplayEmbeddedWalletResultType as y, OpenSsoParamsType as z };
1396
- //# sourceMappingURL=openSso-BWeD0Fb2.d.ts.map
1116
+ export { SendTransactionTxType as A, FinalActionType as B, DisplayModalParamsType as C, ModalStepTypes as D, ModalRpcStepsResultType as E, OpenSsoParamsType as F, MerchantConfigResponse as G, ModalStepMetadata as H, OpenSsoReturnType as I, SdkResolvedConfig as J, ResolvedPlacement as K, PrepareSsoParamsType as L, SiweAuthenticateReturnType as M, SiweAuthenticationParams as N, SendTransactionModalStepType as O, LoginModalStepType as P, PrepareSsoReturnType as R, SharingPageProduct as S, ModalRpcStepsInput as T, IFrameLifecycleEvent as U, FinalModalStepType as V, ClientLifecycleEvent as W, EmbeddedViewActionReferred as _, FrakContextV1 as a, DisplaySharingPageParamsType as b, FrakLifecycleEvent as c, WalletStatusReturnType as d, UserReferralStatusType as f, LoggedOutEmbeddedView as g, DisplayEmbeddedWalletResultType as h, FrakContext as i, SiweAuthenticateModalStepType as j, SendTransactionReturnType as k, IFrameTransport as l, DisplayEmbeddedWalletParamsType as m, ssoPopupFeatures as n, FrakContextV2 as o, SendInteractionParamsType as p, ResolvedSdkConfig as q, ssoPopupName as r, FrakClient as s, openSso as t, IFrameRpcSchema as u, EmbeddedViewActionSharing as v, ModalRpcMetadata as w, DisplaySharingPageResultType as x, LoggedInEmbeddedView as y, SsoMetadata as z };
1117
+ //# sourceMappingURL=openSso-CjZ8lAEA.d.ts.map