@frak-labs/core-sdk 0.1.0-beta.8d103039 → 0.1.0-beta.b0bd1f8a

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 (90) hide show
  1. package/cdn/bundle.iife.js +14 -0
  2. package/dist/actions-CEEObPYc.js +1 -0
  3. package/dist/actions-DbQhWYx8.cjs +1 -0
  4. package/dist/actions.cjs +1 -1
  5. package/dist/actions.d.cts +3 -1481
  6. package/dist/actions.d.ts +3 -1481
  7. package/dist/actions.js +1 -1
  8. package/dist/bundle.cjs +1 -13
  9. package/dist/bundle.d.cts +6 -2087
  10. package/dist/bundle.d.ts +6 -2087
  11. package/dist/bundle.js +1 -13
  12. package/dist/index-7OZ39x1U.d.ts +195 -0
  13. package/dist/index-C6FxkWPC.d.cts +511 -0
  14. package/dist/index-UFX7xCg3.d.ts +351 -0
  15. package/dist/index-d8xS4ryI.d.ts +511 -0
  16. package/dist/index-p4FqSp8z.d.cts +351 -0
  17. package/dist/index-zDq-VlKx.d.cts +195 -0
  18. package/dist/index.cjs +1 -13
  19. package/dist/index.d.cts +4 -1387
  20. package/dist/index.d.ts +4 -1387
  21. package/dist/index.js +1 -13
  22. package/dist/interaction-DMJ3ZfaF.d.cts +45 -0
  23. package/dist/interaction-KX1h9a7V.d.ts +45 -0
  24. package/dist/interactions-DnfM3oe0.js +1 -0
  25. package/dist/interactions-EIXhNLf6.cjs +1 -0
  26. package/dist/interactions.cjs +1 -1
  27. package/dist/interactions.d.cts +2 -182
  28. package/dist/interactions.d.ts +2 -182
  29. package/dist/interactions.js +1 -1
  30. package/dist/openSso-D--Airj6.d.cts +1018 -0
  31. package/dist/openSso-DsKJ4y0j.d.ts +1018 -0
  32. package/dist/productTypes-BUkXJKZ7.cjs +1 -0
  33. package/dist/productTypes-CGb1MmBF.js +1 -0
  34. package/dist/src-B_xO0AR6.cjs +13 -0
  35. package/dist/src-D2d52OZa.js +13 -0
  36. package/dist/trackEvent-CHnYa85W.js +1 -0
  37. package/dist/trackEvent-GuQm_1Nm.cjs +1 -0
  38. package/package.json +21 -17
  39. package/src/actions/displayEmbeddedWallet.test.ts +194 -0
  40. package/src/actions/displayModal.test.ts +387 -0
  41. package/src/actions/getProductInformation.test.ts +133 -0
  42. package/src/actions/index.ts +19 -19
  43. package/src/actions/openSso.test.ts +407 -0
  44. package/src/actions/prepareSso.test.ts +223 -0
  45. package/src/actions/referral/processReferral.ts +1 -1
  46. package/src/actions/referral/referralInteraction.ts +1 -1
  47. package/src/actions/sendInteraction.test.ts +219 -0
  48. package/src/actions/trackPurchaseStatus.test.ts +287 -0
  49. package/src/actions/watchWalletStatus.test.ts +372 -0
  50. package/src/bundle.ts +1 -1
  51. package/src/clients/createIFrameFrakClient.ts +2 -2
  52. package/src/clients/index.ts +1 -1
  53. package/src/clients/setupClient.test.ts +343 -0
  54. package/src/clients/setupClient.ts +3 -1
  55. package/src/clients/transports/iframeLifecycleManager.test.ts +399 -0
  56. package/src/clients/transports/iframeLifecycleManager.ts +3 -1
  57. package/src/index.ts +72 -74
  58. package/src/interactions/index.ts +2 -2
  59. package/src/interactions/pressEncoder.test.ts +215 -0
  60. package/src/interactions/pressEncoder.ts +1 -1
  61. package/src/interactions/purchaseEncoder.test.ts +291 -0
  62. package/src/interactions/purchaseEncoder.ts +8 -3
  63. package/src/interactions/referralEncoder.test.ts +170 -0
  64. package/src/interactions/retailEncoder.test.ts +107 -0
  65. package/src/interactions/retailEncoder.ts +1 -1
  66. package/src/interactions/webshopEncoder.test.ts +56 -0
  67. package/src/types/index.ts +51 -50
  68. package/src/types/lifecycle/index.ts +1 -1
  69. package/src/types/rpc/embedded/loggedIn.ts +1 -1
  70. package/src/types/rpc/embedded/loggedOut.ts +1 -1
  71. package/src/types/rpc/modal/index.ts +11 -11
  72. package/src/utils/FrakContext.test.ts +407 -0
  73. package/src/utils/FrakContext.ts +8 -2
  74. package/src/utils/compression/b64.test.ts +181 -0
  75. package/src/utils/compression/compress.test.ts +123 -0
  76. package/src/utils/compression/decompress.test.ts +145 -0
  77. package/src/utils/compression/index.ts +1 -1
  78. package/src/utils/computeProductId.test.ts +80 -0
  79. package/src/utils/constants.test.ts +23 -0
  80. package/src/utils/formatAmount.test.ts +113 -0
  81. package/src/utils/getCurrencyAmountKey.test.ts +44 -0
  82. package/src/utils/getSupportedCurrency.test.ts +51 -0
  83. package/src/utils/getSupportedLocale.test.ts +64 -0
  84. package/src/utils/iframeHelper.test.ts +450 -0
  85. package/src/utils/iframeHelper.ts +4 -3
  86. package/src/utils/index.ts +12 -12
  87. package/src/utils/sso.test.ts +361 -0
  88. package/src/utils/trackEvent.test.ts +162 -0
  89. package/cdn/bundle.js +0 -19
  90. package/cdn/bundle.js.LICENSE.txt +0 -10
package/dist/index.d.cts CHANGED
@@ -1,1387 +1,4 @@
1
- import type { Address } from 'viem';
2
- import type { Hex } from 'viem';
3
- import type { LifecycleMessage } from '@frak-labs/frame-connector';
4
- import type { OpenPanel } from '@openpanel/web';
5
- import type { RpcClient } from '@frak-labs/frame-connector';
6
- import { RpcMessage } from '@frak-labs/frame-connector';
7
- import { RpcResponse } from '@frak-labs/frame-connector';
8
- import type { SiweMessage } from 'viem/siwe';
9
-
10
- export declare type AppSpecificSsoMetadata = SsoMetadata & {
11
- name: string;
12
- css?: string;
13
- };
14
-
15
- /**
16
- * Decode a base64url encoded string
17
- * @param value The value to decode
18
- * @returns The decoded value
19
- */
20
- export declare function base64urlDecode(value: string): Uint8Array;
21
-
22
- /**
23
- * Encode a buffer to a base64url encoded string
24
- * @param buffer The buffer to encode
25
- * @returns The encoded string
26
- */
27
- export declare function base64urlEncode(buffer: Uint8Array): string;
28
-
29
- /**
30
- * Base props for the iframe
31
- * @ignore
32
- */
33
- export declare const baseIframeProps: {
34
- id: string;
35
- name: string;
36
- title: string;
37
- allow: string;
38
- style: {
39
- width: string;
40
- height: string;
41
- border: string;
42
- position: string;
43
- zIndex: number;
44
- top: string;
45
- left: string;
46
- colorScheme: string;
47
- };
48
- };
49
-
50
- /**
51
- * Event related to the iframe lifecycle
52
- * @ignore
53
- */
54
- export declare type ClientLifecycleEvent = CustomCssEvent | CustomI18nEvent | RestoreBackupEvent | HearbeatEvent | HandshakeResponse | SsoRedirectCompleteEvent;
55
-
56
- /**
57
- * Compress the current Frak context
58
- * @param context - The context to be compressed
59
- * @returns A compressed string containing the Frak context
60
- */
61
- declare function compress(context?: Partial<FrakContext>): string | undefined;
62
-
63
- /**
64
- * The received encoded data from a client
65
- * -> The encoded should contain a HashProtectedData once decoded
66
- * @ignore
67
- */
68
- export declare type CompressedData = Uint8Array;
69
-
70
- /**
71
- * Type of compressed the sso data
72
- */
73
- export declare type CompressedSsoData = {
74
- id?: Hex;
75
- r?: string;
76
- d?: boolean;
77
- l?: "en" | "fr";
78
- p: Hex;
79
- m: {
80
- n: string;
81
- css?: string;
82
- l?: string;
83
- h?: string;
84
- };
85
- };
86
-
87
- /**
88
- * Compress json data
89
- * @param data
90
- * @ignore
91
- */
92
- export declare function compressJsonToB64(data: unknown): string;
93
-
94
- /**
95
- * Create the Frak iframe
96
- * @param args
97
- * @param args.walletBaseUrl - Use `config.walletUrl` instead. Will be removed in future versions.
98
- * @param args.config - The configuration object containing iframe options, including the replacement for `walletBaseUrl`.
99
- */
100
- export declare function createIframe({ walletBaseUrl, config, }: {
101
- walletBaseUrl?: string;
102
- config?: FrakWalletSdkConfig;
103
- }): Promise<HTMLIFrameElement | undefined>;
104
-
105
- /**
106
- * Create a new iframe Frak client
107
- * @param args
108
- * @param args.config - The configuration to use for the Frak Wallet SDK
109
- * @param args.iframe - The iframe to use for the communication
110
- * @returns The created Frak Client
111
- *
112
- * @example
113
- * const frakConfig: FrakWalletSdkConfig = {
114
- * metadata: {
115
- * name: "My app title",
116
- * },
117
- * }
118
- * const iframe = await createIframe({ config: frakConfig });
119
- * const client = createIFrameFrakClient({ config: frakConfig, iframe });
120
- */
121
- export declare function createIFrameFrakClient({ config, iframe, }: {
122
- config: FrakWalletSdkConfig;
123
- iframe: HTMLIFrameElement;
124
- }): FrakClient;
125
-
126
- /**
127
- * All the currencies available
128
- * @category Config
129
- */
130
- export declare type Currency = "eur" | "usd" | "gbp";
131
-
132
- declare type CustomCssEvent = {
133
- clientLifecycle: "modal-css";
134
- data: {
135
- cssLink: string;
136
- };
137
- };
138
-
139
- declare type CustomI18nEvent = {
140
- clientLifecycle: "modal-i18n";
141
- data: {
142
- i18n: I18nConfig;
143
- };
144
- };
145
-
146
- /** @ignore */
147
- export declare class DebugInfoGatherer {
148
- private config?;
149
- private iframe?;
150
- private isSetupDone;
151
- private lastResponse;
152
- private lastRequest;
153
- constructor(config?: FrakWalletSdkConfig, iframe?: HTMLIFrameElement);
154
- setLastResponse(message: RpcMessage, response: RpcResponse): void;
155
- setLastRequest(event: RpcMessage): void;
156
- updateSetupStatus(status: boolean): void;
157
- private base64Encode;
158
- /**
159
- * Extract information from the iframe status
160
- */
161
- private getIframeStatus;
162
- private getNavigatorInfo;
163
- private gatherDebugInfo;
164
- static empty(): DebugInfoGatherer;
165
- /**
166
- * Format Frak debug information
167
- */
168
- formatDebugInfo(error: Error | unknown | string): string;
169
- }
170
-
171
- /**
172
- * Decompress the given Frak context
173
- * @param context - The raw context to be decompressed into a `FrakContext`
174
- * @returns The decompressed Frak context, or undefined if it fails
175
- */
176
- declare function decompress(context?: string): FrakContext | undefined;
177
-
178
- /**
179
- * Decompress json data
180
- * @param data
181
- * @ignore
182
- */
183
- export declare function decompressJsonFromB64<T>(data: string): T | null;
184
-
185
- /**
186
- * The params used to display the embedded wallet
187
- *
188
- * @group Embedded wallet
189
- */
190
- export declare type DisplayEmbeddedWalletParamsType = {
191
- /**
192
- * The embedded view to display once the user is logged in
193
- */
194
- loggedIn?: LoggedInEmbeddedView;
195
- /**
196
- * The embedded view to display once the user is logged out
197
- */
198
- loggedOut?: LoggedOutEmbeddedView;
199
- /**
200
- * Some metadata to customize the embedded view
201
- */
202
- metadata?: {
203
- /**
204
- * The logo to display on the embedded wallet
205
- * If undefined, will default to no logo displayed
206
- */
207
- logo?: string;
208
- /**
209
- * Link to the homepage of the calling website
210
- * If undefined, will default to the domain of the calling website
211
- */
212
- homepageLink?: string;
213
- /**
214
- * The target interaction behind this modal
215
- */
216
- targetInteraction?: FullInteractionTypesKey;
217
- /**
218
- * The position of the component
219
- */
220
- position?: "left" | "right";
221
- /**
222
- * Some i18n override for the displayed modal (i.e. update the displayed text only for this modal)
223
- */
224
- i18n?: I18nConfig;
225
- };
226
- };
227
-
228
- /**
229
- * The result of the display embedded wallet rpc request
230
- *
231
- * @group Embedded wallet
232
- */
233
- export declare type DisplayEmbeddedWalletResultType = {
234
- wallet: Address;
235
- };
236
-
237
- /**
238
- * Params used to display a modal
239
- * @typeParam T - The list of modal steps we expect to have in the modal
240
- * @group Modal Display
241
- */
242
- export declare type DisplayModalParamsType<T extends ModalStepTypes[]> = {
243
- steps: ModalRpcStepsInput<T>;
244
- metadata?: ModalRpcMetadata;
245
- };
246
-
247
- declare type DoBackupEvent = {
248
- iframeLifecycle: "do-backup";
249
- data: {
250
- backup?: string;
251
- };
252
- };
253
-
254
- /**
255
- * The action to display on the logged out embedded view when the user is referred
256
- *
257
- * @group Embedded wallet
258
- */
259
- export declare type EmbeddedViewActionReferred = {
260
- key: "referred";
261
- /**
262
- * No options for a referred action
263
- */
264
- options?: never;
265
- };
266
-
267
- /**
268
- * The different type of action we can have on the embedded view (once the user is logged in)
269
- *
270
- * @group Embedded wallet
271
- */
272
- export declare type EmbeddedViewActionSharing = {
273
- key: "sharing";
274
- /**
275
- * Some sharing options
276
- */
277
- options?: {
278
- /**
279
- * The title that will be displayed on the system popup once the system sharing window is open
280
- * @deprecated Use the top level `config.metadata.i18n` instead
281
- */
282
- popupTitle?: string;
283
- /**
284
- * The text that will be shared alongside the link.
285
- * Can contain the variable {LINK} to specify where the link is placed, otherwise it will be added at the end
286
- * @deprecated Use the top level `config.metadata.i18n` instead
287
- */
288
- text?: string;
289
- /**
290
- * The link to be shared (will be suffixed with the Frak sharing context)
291
- */
292
- link?: string;
293
- };
294
- };
295
-
296
- declare type EventProps = Record<string, unknown>;
297
-
298
- /**
299
- * The different types of final actions we can display in the final step
300
- * @group Modal Display
301
- */
302
- export declare type FinalActionType = {
303
- key: "sharing";
304
- options?: {
305
- /**
306
- * @deprecated Use the top level `config.metadata.i18n` instead
307
- */
308
- popupTitle?: string;
309
- /**
310
- * @deprecated Use the top level `config.metadata.i18n` instead
311
- */
312
- text?: string;
313
- link?: string;
314
- };
315
- } | {
316
- key: "reward";
317
- options?: never;
318
- };
319
-
320
- /**
321
- * The final modal step type, could be used to display sharing options or a success reward screen.
322
- *
323
- * **Input**: What type final step to display?
324
- * **Output**: None
325
- *
326
- * @group Modal Display
327
- */
328
- export declare type FinalModalStepType = GenericModalStepType<"final", {
329
- dismissedMetadata?: ModalStepMetadata["metadata"];
330
- action: FinalActionType;
331
- autoSkip?: boolean;
332
- }, object>;
333
-
334
- /**
335
- * Find an iframe within window.opener by pathname
336
- *
337
- * When a popup is opened via window.open from an iframe, window.opener points to
338
- * the parent window, not the iframe itself. This utility searches through all frames
339
- * in window.opener to find an iframe matching the specified pathname.
340
- *
341
- * @param pathname - The pathname to search for (default: "/listener")
342
- * @returns The matching iframe window, or null if not found
343
- *
344
- * @example
345
- * ```typescript
346
- * // Find the default /listener iframe
347
- * const listenerIframe = findIframeInOpener();
348
- *
349
- * // Find a custom iframe
350
- * const customIframe = findIframeInOpener("/my-custom-iframe");
351
- * ```
352
- */
353
- export declare function findIframeInOpener(pathname?: string): Window | null;
354
-
355
- export declare function formatAmount(amount: number, currency?: Currency): string;
356
-
357
- /**
358
- * Representing a Frak client, used to interact with the Frak Wallet
359
- */
360
- export declare type FrakClient = {
361
- config: FrakWalletSdkConfig;
362
- debugInfo: {
363
- formatDebugInfo: (error: Error | unknown | string) => string;
364
- };
365
- openPanel?: OpenPanel;
366
- } & IFrameTransport;
367
-
368
- /**
369
- * The current Frak Context
370
- *
371
- * For now, only contain a referrer address.
372
- *
373
- * @ignore
374
- */
375
- export declare type FrakContext = {
376
- r: Address;
377
- };
378
-
379
- /**
380
- * Export our frak context
381
- */
382
- export declare const FrakContextManager: {
383
- compress: typeof compress;
384
- decompress: typeof decompress;
385
- parse: typeof parse;
386
- update: typeof update;
387
- remove: typeof remove;
388
- replaceUrl: typeof replaceUrl;
389
- };
390
-
391
- declare type FrakEvent = "share_button_clicked" | "wallet_button_clicked" | "share_modal_error" | "user_referred";
392
-
393
- /**
394
- * Represent an iframe event
395
- */
396
- export declare type FrakLifecycleEvent = IFrameLifecycleEvent | ClientLifecycleEvent;
397
-
398
- /**
399
- * Configuration for the Frak Wallet SDK
400
- * @category Config
401
- */
402
- export declare type FrakWalletSdkConfig = {
403
- /**
404
- * The Frak wallet url
405
- * @defaultValue "https://wallet.frak.id"
406
- */
407
- walletUrl?: string;
408
- /**
409
- * Some metadata about your implementation of the Frak SDK
410
- */
411
- metadata: {
412
- /**
413
- * Your application name (will be displayed in a few modals and in SSO)
414
- */
415
- name: string;
416
- /**
417
- * Language to display in the modal
418
- * If undefined, will default to the browser language
419
- */
420
- lang?: Language;
421
- /**
422
- * The currency to display in the modal
423
- * @defaultValue `"eur"`
424
- */
425
- currency?: Currency;
426
- /**
427
- * The logo URL that will be displayed in a few components
428
- */
429
- logoUrl?: string;
430
- /**
431
- * The homepage link that could be displayed in a few components
432
- */
433
- homepageLink?: string;
434
- };
435
- /**
436
- * Some customization for the modal
437
- */
438
- customizations?: {
439
- /**
440
- * Custom CSS styles to apply to the modals and components
441
- */
442
- css?: `${string}.css`;
443
- /**
444
- * Custom i18n configuration for the modal
445
- */
446
- i18n?: I18nConfig;
447
- };
448
- /**
449
- * The domain name of your application
450
- * @defaultValue window.location.host
451
- */
452
- domain?: string;
453
- };
454
-
455
- /**
456
- * The keys for each interaction types (e.g. `press.openArticle`) -> category_type.interaction_type
457
- * @inline
458
- */
459
- export declare type FullInteractionTypesKey = {
460
- [Category in keyof typeof interactionTypes]: `${Category & string}.${keyof (typeof interactionTypes)[Category] & string}`;
461
- }[keyof typeof interactionTypes];
462
-
463
- /**
464
- * The full SSO params that will be used for compression
465
- */
466
- export declare type FullSsoParams = Omit<PrepareSsoParamsType, "metadata"> & {
467
- metadata: AppSpecificSsoMetadata;
468
- productId: Hex;
469
- };
470
-
471
- /**
472
- * Generate SSO URL with compressed parameters
473
- * This mirrors the wallet's getOpenSsoLink() function
474
- *
475
- * @param walletUrl - Base wallet URL (e.g., "https://wallet.frak.id")
476
- * @param params - SSO parameters
477
- * @param productId - Product identifier
478
- * @param name - Application name
479
- * @param css - Optional custom CSS
480
- * @returns Complete SSO URL ready to open in popup or redirect
481
- *
482
- * @example
483
- * ```ts
484
- * const ssoUrl = generateSsoUrl(
485
- * "https://wallet.frak.id",
486
- * { metadata: { logoUrl: "..." }, directExit: true },
487
- * "0x123...",
488
- * "My App"
489
- * );
490
- * // Returns: https://wallet.frak.id/sso?p=<compressed_base64>
491
- * ```
492
- */
493
- export declare function generateSsoUrl(walletUrl: string, params: PrepareSsoParamsType, productId: Hex, name: string, css?: string): string;
494
-
495
- /**
496
- * Represent a generic modal step type
497
- * @ignore
498
- * @inline
499
- */
500
- declare type GenericModalStepType<TKey, TParams, TReturns> = {
501
- key: TKey;
502
- params: TParams extends never ? ModalStepMetadata : ModalStepMetadata & TParams;
503
- returns: TReturns;
504
- };
505
-
506
- /**
507
- * Get the currency amount key for a given currency
508
- * @param currency - The currency to use
509
- * @returns The currency amount key
510
- */
511
- export declare function getCurrencyAmountKey(currency?: Currency): keyof TokenAmountType;
512
-
513
- /**
514
- * Response of the `frak_getProductInformation` RPC method
515
- * @group RPC Schema
516
- */
517
- export declare type GetProductInformationReturnType = {
518
- /**
519
- * Current product id
520
- */
521
- id: Hex;
522
- /**
523
- * Some metadata
524
- */
525
- onChainMetadata: {
526
- /**
527
- * Name of the product on-chain
528
- */
529
- name: string;
530
- /**
531
- * Domain of the product on-chain
532
- */
533
- domain: string;
534
- /**
535
- * The supported product types
536
- */
537
- productTypes: ProductTypesKey[];
538
- };
539
- /**
540
- * The max potential reward for the referrer
541
- */
542
- maxReferrer?: TokenAmountType;
543
- /**
544
- * The max potential reward for the referee
545
- */
546
- maxReferee?: TokenAmountType;
547
- /**
548
- * List of all the potentials reward arround this product
549
- */
550
- rewards: {
551
- token: Address;
552
- campaign: Address;
553
- interactionTypeKey: FullInteractionTypesKey;
554
- referrer: TokenAmountType;
555
- referee: TokenAmountType;
556
- }[];
557
- };
558
-
559
- /**
560
- * Get the supported currency for a given currency
561
- * @param currency - The currency to use
562
- * @returns The supported currency
563
- */
564
- export declare function getSupportedCurrency(currency?: Currency): Currency;
565
-
566
- /**
567
- * Get the supported locale for a given currency
568
- * @param currency - The currency to use
569
- * @returns The supported locale
570
- */
571
- export declare function getSupportedLocale(currency?: Currency): (typeof locales)[LocalesKey];
572
-
573
- declare type HandshakeRequestEvent = {
574
- iframeLifecycle: "handshake";
575
- data: {
576
- token: string;
577
- };
578
- };
579
-
580
- declare type HandshakeResponse = {
581
- clientLifecycle: "handshake-response";
582
- data: {
583
- token: string;
584
- currentUrl: string;
585
- };
586
- };
587
-
588
- /**
589
- * The encoded data to send to a client / received by a client
590
- * @ignore
591
- */
592
- export declare type HashProtectedData<DataType> = Readonly<DataType & {
593
- validationHash: string;
594
- }>;
595
-
596
- declare type HearbeatEvent = {
597
- clientLifecycle: "heartbeat";
598
- data?: never;
599
- };
600
-
601
- /**
602
- * Custom i18n configuration for the modal
603
- * See [i18next json format](https://www.i18next.com/misc/json-format#i18next-json-v4)
604
- *
605
- * Available variables
606
- * - `{{ productName }}` : The name of your website (`metadata.name`)
607
- * - `{{ productOrigin }}` : The origin url of your website
608
- * - `{{ 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)
609
- *
610
- * Context of the translation [see i18n context](https://www.i18next.com/translation-function/context)
611
- * - For modal display, the key of the final action (`sharing`, `reward`, or undefined)
612
- * - For embedded wallet display, the key of the logged in action (`sharing` or undefined)
613
- *
614
- * @example
615
- * ```ts
616
- * // Multi language config
617
- * const multiI18n = {
618
- * fr: {
619
- * "sdk.modal.title": "Titre de modal",
620
- * "sdk.modal.description": "Description de modal, avec {{ estimatedReward }} de gains possible",
621
- * },
622
- * en: "https://example.com/en.json"
623
- * }
624
- *
625
- * // Single language config
626
- * const singleI18n = {
627
- * "sdk.modal.title": "Modal title",
628
- * "sdk.modal.description": "Modal description, with {{ estimatedReward }} of gains possible",
629
- * }
630
- * ```
631
- *
632
- * @category Config
633
- */
634
- export declare type I18nConfig = Record<Language, LocalizedI18nConfig> | LocalizedI18nConfig;
635
-
636
- /**
637
- * Event related to the iframe lifecycle
638
- * @ignore
639
- */
640
- export declare type IFrameLifecycleEvent = {
641
- iframeLifecycle: "connected" | "show" | "hide" | "remove-backup";
642
- data?: never;
643
- } | DoBackupEvent | HandshakeRequestEvent | RedirectRequestEvent;
644
-
645
- /**
646
- * RPC interface that's used for the iframe communication
647
- *
648
- * Define all the methods available within the iFrame RPC client with response type annotations
649
- *
650
- * @group RPC Schema
651
- *
652
- * @remarks
653
- * Each method in the schema now includes a ResponseType field that indicates:
654
- * - "promise": One-shot request that resolves once
655
- * - "stream": Streaming request that can emit multiple values
656
- *
657
- * ### Methods:
658
- *
659
- * #### frak_listenToWalletStatus
660
- * - Params: None
661
- * - Returns: {@link WalletStatusReturnType}
662
- * - Response Type: stream (emits updates when wallet status changes)
663
- *
664
- * #### frak_displayModal
665
- * - Params: [requests: {@link ModalRpcStepsInput}, metadata?: {@link ModalRpcMetadata}, configMetadata: {@link FrakWalletSdkConfig}["metadata"]]
666
- * - Returns: {@link ModalRpcStepsResultType}
667
- * - Response Type: promise (one-shot)
668
- *
669
- * #### frak_sendInteraction
670
- * - Params: [productId: Hex, interaction: {@link PreparedInteraction}, signature?: Hex]
671
- * - Returns: {@link SendInteractionReturnType}
672
- * - Response Type: promise (one-shot)
673
- *
674
- * #### frak_sso
675
- * - Params: [params: {@link OpenSsoParamsType}, name: string, customCss?: string]
676
- * - Returns: {@link OpenSsoReturnType}
677
- * - Response Type: promise (one-shot)
678
- *
679
- * #### frak_getProductInformation
680
- * - Params: None
681
- * - Returns: {@link GetProductInformationReturnType}
682
- * - Response Type: promise (one-shot)
683
- *
684
- * #### frak_displayEmbeddedWallet
685
- * - Params: [request: {@link DisplayEmbeddedWalletParamsType}, metadata: {@link FrakWalletSdkConfig}["metadata"]]
686
- * - Returns: {@link DisplayEmbeddedWalletResultType}
687
- * - Response Type: promise (one-shot)
688
- */
689
- export declare type IFrameRpcSchema = [
690
- /**
691
- * Method used to listen to the wallet status
692
- * This is a streaming method that emits updates when wallet status changes
693
- */
694
- {
695
- Method: "frak_listenToWalletStatus";
696
- Parameters?: undefined;
697
- ReturnType: WalletStatusReturnType;
698
- },
699
- /**
700
- * Method to display a modal with the provided steps
701
- * This is a one-shot request
702
- */
703
- {
704
- Method: "frak_displayModal";
705
- Parameters: [
706
- requests: ModalRpcStepsInput,
707
- metadata: ModalRpcMetadata | undefined,
708
- configMetadata: FrakWalletSdkConfig["metadata"]
709
- ];
710
- ReturnType: ModalRpcStepsResultType;
711
- },
712
- /**
713
- * Method to transmit a user interaction
714
- * This is a one-shot request
715
- */
716
- {
717
- Method: "frak_sendInteraction";
718
- Parameters: [
719
- productId: Hex,
720
- interaction: PreparedInteraction,
721
- signature?: Hex
722
- ];
723
- ReturnType: SendInteractionReturnType;
724
- },
725
- /**
726
- * Method to prepare SSO (generate URL for popup)
727
- * Returns the SSO URL that should be opened in a popup
728
- * Only used for popup flows (not redirect flows)
729
- */
730
- {
731
- Method: "frak_prepareSso";
732
- Parameters: [
733
- params: PrepareSsoParamsType,
734
- name: string,
735
- customCss?: string
736
- ];
737
- ReturnType: PrepareSsoReturnType;
738
- },
739
- /**
740
- * Method to open/trigger SSO
741
- * Either triggers redirect (if openInSameWindow/redirectUrl)
742
- * Or waits for popup completion (if popup mode)
743
- * This method handles BOTH redirect and popup flows
744
- */
745
- {
746
- Method: "frak_openSso";
747
- Parameters: [
748
- params: OpenSsoParamsType,
749
- name: string,
750
- customCss?: string
751
- ];
752
- ReturnType: OpenSsoReturnType;
753
- },
754
- /**
755
- * Method to get current product information's
756
- * - Is product minted?
757
- * - Does it have running campaign?
758
- * - Estimated reward on actions
759
- * This is a one-shot request
760
- */
761
- {
762
- Method: "frak_getProductInformation";
763
- Parameters?: undefined;
764
- ReturnType: GetProductInformationReturnType;
765
- },
766
- /**
767
- * Method to show the embedded wallet, with potential customization
768
- * This is a one-shot request
769
- */
770
- {
771
- Method: "frak_displayEmbeddedWallet";
772
- Parameters: [
773
- request: DisplayEmbeddedWalletParamsType,
774
- metadata: FrakWalletSdkConfig["metadata"]
775
- ];
776
- ReturnType: DisplayEmbeddedWalletResultType;
777
- }
778
- ];
779
-
780
- /**
781
- * IFrame transport interface
782
- */
783
- export declare type IFrameTransport = {
784
- /**
785
- * Wait for the connection to be established
786
- */
787
- waitForConnection: Promise<boolean>;
788
- /**
789
- * Wait for the setup to be done
790
- */
791
- waitForSetup: Promise<void>;
792
- /**
793
- * Function used to perform a single request via the iframe transport
794
- */
795
- request: RpcClient<IFrameRpcSchema, LifecycleMessage>["request"];
796
- /**
797
- * Function used to listen to a request response via the iframe transport
798
- */
799
- listenerRequest: RpcClient<IFrameRpcSchema, LifecycleMessage>["listen"];
800
- /**
801
- * Function used to destroy the iframe transport
802
- */
803
- destroy: () => Promise<void>;
804
- };
805
-
806
- /**
807
- * Each interactions types according to the product types
808
- */
809
- export declare const interactionTypes: {
810
- readonly press: {
811
- readonly openArticle: "0xc0a24ffb";
812
- readonly readArticle: "0xd5bd0fbe";
813
- };
814
- readonly dapp: {
815
- readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
816
- readonly callableVerifiableStorageUpdate: "0xa07da986";
817
- };
818
- readonly webshop: {
819
- readonly open: "0xb311798f";
820
- };
821
- readonly referral: {
822
- readonly referred: "0x010cc3b9";
823
- readonly createLink: "0xb2c0f17c";
824
- };
825
- readonly purchase: {
826
- readonly started: "0xd87e90c3";
827
- readonly completed: "0x8403aeb4";
828
- readonly unsafeCompleted: "0x4d5b14e0";
829
- };
830
- readonly retail: {
831
- readonly customerMeeting: "0x74489004";
832
- };
833
- };
834
-
835
- /**
836
- * The final keys for each interaction types (e.g. `openArticle`) -> interaction type
837
- * @inline
838
- */
839
- export declare type InteractionTypesKey = {
840
- [K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
841
- }[keyof typeof interactionTypes];
842
-
843
- /**
844
- * Represent a key provider used for the hashed and secure compression
845
- * @ignore
846
- */
847
- export declare type KeyProvider<DataType> = (value: DataType) => string[];
848
-
849
- /**
850
- * All the languages available
851
- * @category Config
852
- */
853
- export declare type Language = "fr" | "en";
854
-
855
- /**
856
- * Map the currency to the locale
857
- */
858
- export declare const locales: {
859
- readonly eur: "fr-FR";
860
- readonly usd: "en-US";
861
- readonly gbp: "en-GB";
862
- };
863
-
864
- /**
865
- * The keys for each locales
866
- * @inline
867
- */
868
- export declare type LocalesKey = keyof typeof locales;
869
-
870
- /**
871
- * A localized i18n config
872
- * @category Config
873
- */
874
- export declare type LocalizedI18nConfig = `${string}.css` | {
875
- [key: string]: string;
876
- };
877
-
878
- /**
879
- * Some configuration options for the embedded view
880
- *
881
- * @group Embedded wallet
882
- */
883
- export declare type LoggedInEmbeddedView = {
884
- /**
885
- * The main action to display on the logged in embedded view
886
- */
887
- action?: EmbeddedViewActionSharing | EmbeddedViewActionReferred;
888
- };
889
-
890
- /**
891
- * The view when a user is logged out
892
- * @group Embedded wallet
893
- */
894
- export declare type LoggedOutEmbeddedView = {
895
- /**
896
- * Metadata option when displaying the embedded view
897
- */
898
- metadata?: {
899
- /**
900
- * The main CTA for the logged out view
901
- * - can include some variable, available ones are:
902
- * - {REWARD} -> The maximum reward a user can receive when interacting on your website
903
- * - can be formatted in markdown
904
- *
905
- * If not set, it will default to a internationalized message
906
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
907
- */
908
- text?: string;
909
- /**
910
- * The text that will be displayed on the login button
911
- *
912
- * If not set, it will default to a internationalized message
913
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
914
- */
915
- buttonText?: string;
916
- };
917
- };
918
-
919
- /**
920
- * The login step for a Modal
921
- *
922
- * **Input**: Do we allow SSO or not? Is yes then the SSO metadata
923
- * **Output**: The logged in wallet address
924
- *
925
- * @group Modal Display
926
- */
927
- export declare type LoginModalStepType = GenericModalStepType<"login", LoginWithSso | LoginWithoutSso, {
928
- wallet: Address;
929
- }>;
930
-
931
- /** @inline */
932
- declare type LoginWithoutSso = {
933
- allowSso?: false;
934
- ssoMetadata?: never;
935
- };
936
-
937
- /** @inline */
938
- declare type LoginWithSso = {
939
- allowSso: true;
940
- ssoMetadata?: SsoMetadata;
941
- };
942
-
943
- /**
944
- * RPC metadata for the modal, used on top level modal configuration
945
- * @group Modal Display
946
- * @group RPC Schema
947
- */
948
- export declare type ModalRpcMetadata = {
949
- header?: {
950
- title?: string;
951
- icon?: string;
952
- };
953
- targetInteraction?: FullInteractionTypesKey;
954
- /**
955
- * Some i18n override for the displayed modal (i.e. update the displayed text only for this modal)
956
- */
957
- i18n?: I18nConfig;
958
- } & ({
959
- isDismissible: true;
960
- /**
961
- * @deprecated Use `config.customizations.i18n` or `metadata.i18n` instead
962
- */
963
- dismissActionTxt?: string;
964
- } | {
965
- isDismissible?: false;
966
- dismissActionTxt?: never;
967
- });
968
-
969
- /**
970
- * Type for the RPC input of a modal
971
- * Just the `params` type of each `ModalStepTypes`
972
- * @typeParam T - The list of modal steps we expect to have in the modal
973
- * @group Modal Display
974
- * @group RPC Schema
975
- */
976
- export declare type ModalRpcStepsInput<T extends ModalStepTypes[] = ModalStepTypes[]> = {
977
- [K in T[number]["key"]]?: Extract<T[number], {
978
- key: K;
979
- }>["params"];
980
- };
981
-
982
- /**
983
- * Type for the result of a modal request
984
- * Just the `returns` type of each `ModalStepTypes`
985
- * @typeParam T - The list of modal steps we expect to have in the modal
986
- * @group Modal Display
987
- * @group RPC Schema
988
- */
989
- export declare type ModalRpcStepsResultType<T extends ModalStepTypes[] = ModalStepTypes[]> = {
990
- [K in T[number]["key"]]: Extract<T[number], {
991
- key: K;
992
- }>["returns"];
993
- };
994
-
995
- /**
996
- * Metadata that can be used to customize a modal step
997
- * @group Modal Display
998
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
999
- */
1000
- export declare type ModalStepMetadata = {
1001
- metadata?: {
1002
- /**
1003
- * Custom title for the step
1004
- * If none provided, it will use an internationalized text
1005
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
1006
- */
1007
- title?: string;
1008
- /**
1009
- * Custom description for the step
1010
- * If none provided, it will use an internationalized text
1011
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
1012
- */
1013
- description?: string;
1014
- /**
1015
- * Custom text for the primary action of the step
1016
- * If none provided, it will use an internationalized text
1017
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
1018
- */
1019
- primaryActionText?: string;
1020
- /**
1021
- * Custom text for the secondary action of the step
1022
- * If none provided, it will use an internationalized text
1023
- * @deprecated Use the top level `config.customizations.i18n`, or `metadata.i18n` instead
1024
- */
1025
- secondaryActionText?: string;
1026
- };
1027
- };
1028
-
1029
- /**
1030
- * Generic type of steps we will display in the modal to the end user
1031
- * @group Modal Display
1032
- */
1033
- export declare type ModalStepTypes = LoginModalStepType | SiweAuthenticateModalStepType | SendTransactionModalStepType | OpenInteractionSessionModalStepType | FinalModalStepType;
1034
-
1035
- /**
1036
- * The open interaction session step for a Modal
1037
- *
1038
- * **Input**: None
1039
- * **Output**: The interactions session period (start and end timestamp)
1040
- *
1041
- * @group Modal Display
1042
- */
1043
- export declare type OpenInteractionSessionModalStepType = GenericModalStepType<"openSession", object, OpenInteractionSessionReturnType>;
1044
-
1045
- /**
1046
- * Return type of the open session modal step
1047
- * @inline
1048
- * @ignore
1049
- */
1050
- export declare type OpenInteractionSessionReturnType = {
1051
- startTimestamp: number;
1052
- endTimestamp: number;
1053
- };
1054
-
1055
- /**
1056
- * Params to start a SSO
1057
- * @group RPC Schema
1058
- */
1059
- export declare type OpenSsoParamsType = PrepareSsoParamsType & {
1060
- /**
1061
- * Indicate whether we want todo the flow within the same window context, or if we want to do it with an external popup window openned
1062
- * Note: Default true if redirectUrl is present, otherwise, false
1063
- */
1064
- openInSameWindow?: boolean;
1065
- /**
1066
- * Custom SSO popup url if user want additionnal customisation
1067
- */
1068
- ssoPopupUrl?: string;
1069
- };
1070
-
1071
- /**
1072
- * Response after an SSO has been openned
1073
- */
1074
- export declare type OpenSsoReturnType = {
1075
- /**
1076
- * Optional wallet address, returned when SSO completes via postMessage
1077
- * Note: Only present when SSO flow completes (not immediately on open)
1078
- */
1079
- wallet?: Hex;
1080
- };
1081
-
1082
- /**
1083
- * Parse the current URL into a Frak Context
1084
- * @param args
1085
- * @param args.url - The url to parse
1086
- * @returns The parsed Frak context
1087
- */
1088
- declare function parse({ url }: {
1089
- url: string;
1090
- }): FrakContext | null | undefined;
1091
-
1092
- /**
1093
- * Represent a prepared user interaction, ready to be sent on-chain via the wallet
1094
- */
1095
- export declare type PreparedInteraction = {
1096
- handlerTypeDenominator: Hex;
1097
- interactionData: Hex;
1098
- };
1099
-
1100
- /**
1101
- * Params for preparing SSO (generating URL)
1102
- * Same as OpenSsoParamsType but without openInSameWindow (popup-only operation)
1103
- * @group RPC Schema
1104
- */
1105
- export declare type PrepareSsoParamsType = {
1106
- /**
1107
- * Redirect URL after the SSO (optional)
1108
- */
1109
- redirectUrl?: string;
1110
- /**
1111
- * If the SSO should directly exit after completion
1112
- * @defaultValue true
1113
- */
1114
- directExit?: boolean;
1115
- /**
1116
- * Language of the SSO page (optional)
1117
- * It will default to the current user language (or "en" if unsupported language)
1118
- */
1119
- lang?: "en" | "fr";
1120
- /**
1121
- * Custom SSO metadata
1122
- */
1123
- metadata?: SsoMetadata;
1124
- };
1125
-
1126
- /**
1127
- * Response after preparing SSO
1128
- * @group RPC Schema
1129
- */
1130
- export declare type PrepareSsoReturnType = {
1131
- /**
1132
- * The SSO URL that should be opened in a popup
1133
- */
1134
- ssoUrl: string;
1135
- };
1136
-
1137
- /**
1138
- * List of the product types per denominator
1139
- */
1140
- export declare const productTypes: {
1141
- dapp: number;
1142
- press: number;
1143
- webshop: number;
1144
- retail: number;
1145
- referral: number;
1146
- purchase: number;
1147
- };
1148
-
1149
- /**
1150
- * The keys for each product types
1151
- * @inline
1152
- */
1153
- export declare type ProductTypesKey = keyof typeof productTypes;
1154
-
1155
- /**
1156
- * Bitmask for each product types
1157
- */
1158
- export declare const productTypesMask: Record<ProductTypesKey, bigint>;
1159
-
1160
- declare type RedirectRequestEvent = {
1161
- iframeLifecycle: "redirect";
1162
- data: {
1163
- /**
1164
- * The base url to redirect to
1165
- * If it contain a query param `u`, the client need will suffix the current url to the base url
1166
- */
1167
- baseRedirectUrl: string;
1168
- };
1169
- };
1170
-
1171
- /**
1172
- * Remove Frak context from current url
1173
- * @param url - The url to update
1174
- * @returns The new url without the Frak context
1175
- */
1176
- declare function remove(url: string): string;
1177
-
1178
- /**
1179
- * Replace the current url with the given Frak context
1180
- * @param args
1181
- * @param args.url - The url to update
1182
- * @param args.context - The context to update
1183
- */
1184
- declare function replaceUrl({ url: baseUrl, context, }: {
1185
- url?: string;
1186
- context: Partial<FrakContext> | null;
1187
- }): void;
1188
-
1189
- declare type RestoreBackupEvent = {
1190
- clientLifecycle: "restore-backup";
1191
- data: {
1192
- backup: string;
1193
- };
1194
- };
1195
-
1196
- /**
1197
- * Parameters that will be used to send an interaction to the blockchain
1198
- * @inline
1199
- */
1200
- export declare type SendInteractionParamsType = {
1201
- /**
1202
- * The product id where this interaction has been made
1203
- * @defaultValue keccak256(toHex(window.location.host))
1204
- */
1205
- productId?: Hex;
1206
- /**
1207
- * The prepared interaction, built from an Interaction Encoder
1208
- */
1209
- interaction: PreparedInteraction;
1210
- /**
1211
- * A pre-computed interaction signature
1212
- * If none provided, the delegated interaction validator of your product will sign it (you can manage it in the business dashboard)
1213
- *
1214
- * @defaultValue undefined
1215
- */
1216
- validation?: Hex;
1217
- };
1218
-
1219
- /**
1220
- * Return type of the send interaction rpc request
1221
- * @group RPC Schema
1222
- */
1223
- export declare type SendInteractionReturnType = {
1224
- /**
1225
- * The id of the interaction in the interaction pool
1226
- */
1227
- delegationId: string;
1228
- };
1229
-
1230
- /**
1231
- * The send transaction step for a Modal
1232
- *
1233
- * **Input**: Either a single tx or an array of tx to be sent
1234
- * **Output**: The hash of the tx(s) hash (in case of multiple tx, still returns a single hash because it's bundled on the wallet level)
1235
- *
1236
- * @group Modal Display
1237
- */
1238
- export declare type SendTransactionModalStepType = GenericModalStepType<"sendTransaction", {
1239
- tx: SendTransactionTxType | SendTransactionTxType[];
1240
- }, SendTransactionReturnType>;
1241
-
1242
- /**
1243
- * Return type of the send transaction rpc request
1244
- * @inline
1245
- */
1246
- export declare type SendTransactionReturnType = {
1247
- hash: Hex;
1248
- };
1249
-
1250
- /**
1251
- * Generic format representing a tx to be sent
1252
- */
1253
- export declare type SendTransactionTxType = {
1254
- to: Address;
1255
- data?: Hex;
1256
- value?: Hex;
1257
- };
1258
-
1259
- /**
1260
- * Directly setup the Frak client with an iframe
1261
- * Return when the FrakClient is ready (setup and communication estbalished with the wallet)
1262
- *
1263
- * @param config - The configuration to use for the Frak Wallet SDK
1264
- * @returns a Promise with the Frak Client
1265
- *
1266
- * @example
1267
- * const frakConfig: FrakWalletSdkConfig = {
1268
- * metadata: {
1269
- * name: "My app title",
1270
- * },
1271
- * }
1272
- * const client = await setupClient({ config: frakConfig });
1273
- */
1274
- export declare function setupClient({ config, }: {
1275
- config: FrakWalletSdkConfig;
1276
- }): Promise<FrakClient | undefined>;
1277
-
1278
- /**
1279
- * The SIWE authentication step for a Modal
1280
- *
1281
- * **Input**: SIWE message parameters
1282
- * **Output**: SIWE result (message signed and wallet signature)
1283
- *
1284
- * @group Modal Display
1285
- */
1286
- export declare type SiweAuthenticateModalStepType = GenericModalStepType<"siweAuthenticate", {
1287
- siwe: SiweAuthenticationParams;
1288
- }, SiweAuthenticateReturnType>;
1289
-
1290
- /**
1291
- * Return type of the Siwe transaction rpc request
1292
- * @inline
1293
- */
1294
- export declare type SiweAuthenticateReturnType = {
1295
- signature: Hex;
1296
- message: string;
1297
- };
1298
-
1299
- /**
1300
- * Parameters used send a SIWE rpc request
1301
- */
1302
- export declare type SiweAuthenticationParams = Omit<SiweMessage, "address" | "chainId" | "expirationTime" | "issuedAt" | "notBefore"> & {
1303
- expirationTimeTimestamp?: number;
1304
- notBeforeTimestamp?: number;
1305
- };
1306
-
1307
- /**
1308
- * SSO Metadata
1309
- */
1310
- export declare type SsoMetadata = {
1311
- /**
1312
- * URL to your client, if provided will be displayed in the SSO header
1313
- */
1314
- logoUrl?: string;
1315
- /**
1316
- * Link to your homepage, if referenced your app name will contain a link on the sso page
1317
- */
1318
- homepageLink?: string;
1319
- };
1320
-
1321
- export declare const ssoPopupFeatures = "menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800";
1322
-
1323
- export declare const ssoPopupName = "frak-sso";
1324
-
1325
- declare type SsoRedirectCompleteEvent = {
1326
- clientLifecycle: "sso-redirect-complete";
1327
- data: {
1328
- compressed: string;
1329
- };
1330
- };
1331
-
1332
- /**
1333
- * The type for the amount of tokens
1334
- */
1335
- export declare type TokenAmountType = {
1336
- amount: number;
1337
- eurAmount: number;
1338
- usdAmount: number;
1339
- gbpAmount: number;
1340
- };
1341
-
1342
- export declare function trackEvent(client: FrakClient | undefined, event: FrakEvent, props?: EventProps): void;
1343
-
1344
- /**
1345
- * Populate the current url with the given Frak context
1346
- * @param args
1347
- * @param args.url - The url to update
1348
- * @param args.context - The context to update
1349
- * @returns The new url with the Frak context
1350
- */
1351
- declare function update({ url, context, }: {
1352
- url?: string;
1353
- context: Partial<FrakContext>;
1354
- }): string | null;
1355
-
1356
- /**
1357
- * @ignore
1358
- * @inline
1359
- */
1360
- declare type WalletConnected = {
1361
- key: "connected";
1362
- wallet: Address;
1363
- interactionToken?: string;
1364
- interactionSession?: {
1365
- startTimestamp: number;
1366
- endTimestamp: number;
1367
- };
1368
- };
1369
-
1370
- /**
1371
- * @ignore
1372
- * @inline
1373
- */
1374
- declare type WalletNotConnected = {
1375
- key: "not-connected";
1376
- wallet?: never;
1377
- interactionToken?: never;
1378
- interactionSession?: never;
1379
- };
1380
-
1381
- /**
1382
- * RPC Response for the method `frak_listenToWalletStatus`
1383
- * @group RPC Schema
1384
- */
1385
- export declare type WalletStatusReturnType = WalletConnected | WalletNotConnected;
1386
-
1387
- export { }
1
+ import { A as SiweAuthenticateReturnType, B as FinalActionType, C as ModalRpcStepsInput, D as SendTransactionReturnType, E as SendTransactionModalStepType, F as OpenSsoParamsType, G as interactionTypes, H as ModalStepMetadata, I as OpenSsoReturnType, J as Currency, K as IFrameLifecycleEvent, L as PrepareSsoParamsType, M as OpenInteractionSessionModalStepType, N as OpenInteractionSessionReturnType, O as SendTransactionTxType, P as LoginModalStepType, Q as LocalizedI18nConfig, R as PrepareSsoReturnType, S as ModalRpcMetadata, T as ModalStepTypes, U as FullInteractionTypesKey, V as FinalModalStepType, W as InteractionTypesKey, X as I18nConfig, Y as FrakWalletSdkConfig, Z as Language, _ as LoggedOutEmbeddedView, a as FrakClient, b as LoggedInEmbeddedView, c as IFrameRpcSchema, d as TokenAmountType, f as ProductTypesKey, g as DisplayEmbeddedWalletResultType, h as DisplayEmbeddedWalletParamsType, i as FrakContext, j as SiweAuthenticationParams, k as SiweAuthenticateModalStepType, l as WalletStatusReturnType, m as productTypesMask, n as ssoPopupFeatures, o as FrakLifecycleEvent, p as productTypes, q as ClientLifecycleEvent, r as ssoPopupName, s as IFrameTransport, u as GetProductInformationReturnType, v as EmbeddedViewActionReferred, w as ModalRpcStepsResultType, x as DisplayModalParamsType, y as EmbeddedViewActionSharing, z as SsoMetadata } from "./openSso-D--Airj6.cjs";
2
+ import { n as SendInteractionParamsType, r as SendInteractionReturnType, t as PreparedInteraction } from "./interaction-DMJ3ZfaF.cjs";
3
+ import { C as CompressedData, S as createIFrameFrakClient, T as KeyProvider, _ as base64urlEncode, a as generateSsoUrl, b as setupClient, c as findIframeInOpener, d as getCurrencyAmountKey, f as formatAmount, g as base64urlDecode, h as compressJsonToB64, i as FullSsoParams, l as getSupportedLocale, m as decompressJsonFromB64, n as AppSpecificSsoMetadata, o as baseIframeProps, p as FrakContextManager, r as CompressedSsoData, s as createIframe, t as trackEvent, u as getSupportedCurrency, v as LocalesKey, w as HashProtectedData, x as DebugInfoGatherer, y as locales } from "./index-p4FqSp8z.cjs";
4
+ export { AppSpecificSsoMetadata, ClientLifecycleEvent, CompressedData, CompressedSsoData, Currency, DebugInfoGatherer, DisplayEmbeddedWalletParamsType, DisplayEmbeddedWalletResultType, DisplayModalParamsType, EmbeddedViewActionReferred, EmbeddedViewActionSharing, FinalActionType, FinalModalStepType, FrakClient, FrakContext, FrakContextManager, FrakLifecycleEvent, FrakWalletSdkConfig, FullInteractionTypesKey, FullSsoParams, GetProductInformationReturnType, HashProtectedData, I18nConfig, IFrameLifecycleEvent, IFrameRpcSchema, IFrameTransport, InteractionTypesKey, KeyProvider, Language, LocalesKey, LocalizedI18nConfig, LoggedInEmbeddedView, LoggedOutEmbeddedView, LoginModalStepType, ModalRpcMetadata, ModalRpcStepsInput, ModalRpcStepsResultType, ModalStepMetadata, ModalStepTypes, OpenInteractionSessionModalStepType, OpenInteractionSessionReturnType, OpenSsoParamsType, OpenSsoReturnType, PrepareSsoParamsType, PrepareSsoReturnType, PreparedInteraction, ProductTypesKey, SendInteractionParamsType, SendInteractionReturnType, SendTransactionModalStepType, SendTransactionReturnType, SendTransactionTxType, SiweAuthenticateModalStepType, SiweAuthenticateReturnType, SiweAuthenticationParams, SsoMetadata, TokenAmountType, WalletStatusReturnType, base64urlDecode, base64urlEncode, baseIframeProps, compressJsonToB64, createIFrameFrakClient, createIframe, decompressJsonFromB64, findIframeInOpener, formatAmount, generateSsoUrl, getCurrencyAmountKey, getSupportedCurrency, getSupportedLocale, interactionTypes, locales, productTypes, productTypesMask, setupClient, ssoPopupFeatures, ssoPopupName, trackEvent };