@frak-labs/core-sdk 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,255 +1,1207 @@
1
- import { F as FrakWalletSdkConfig, a as FrakClient, I as IFrameEvent, b as FrakContext } from './context-rDsQbSgB.js';
2
- export { C as ClientLifecycleEvent, D as DisplayEmbededWalletParamsType, j as DisplayModalParamsType, E as EmbededViewAction, H as ExtractedParametersFromRpc, J as ExtractedReturnTypeFromRpc, y as FinalActionType, x as FinalModalStepType, e as FullInteractionTypesKey, G as GetProductInformationReturnType, B as IFrameLifecycleEvent, A as IFrameRpcEvent, f as IFrameRpcSchema, z as IFrameTransport, d as InteractionTypesKey, g as LoggedInEmbededView, L as LoggedOutEmbededView, n as LoginModalStepType, h as ModalRpcMetadata, k as ModalRpcStepsInput, l as ModalRpcStepsResultType, m as ModalStepMetadata, M as ModalStepTypes, w as OpenInteractionSessionModalStepType, v as OpenInteractionSessionReturnType, O as OpenSsoParamsType, P as ProductTypesKey, R as RpcResponse, t as SendTransactionModalStepType, u as SendTransactionReturnType, s as SendTransactionTxType, o as SiweAuthenticateModalStepType, r as SiweAuthenticateReturnType, q as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType, i as interactionTypes, p as productTypes, c as productTypesMask } from './context-rDsQbSgB.js';
3
- export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from './interaction-CTQ5-kqe.js';
4
- import 'viem';
5
- import 'viem/chains';
6
- import 'viem/siwe';
7
-
8
- /**
9
- * Create a new iframe Frak client
10
- * @param args
11
- * @param args.config - The configuration to use for the Frak Wallet SDK
12
- * @param args.iframe - The iframe to use for the communication
13
- * @returns The created Frak Client
14
- *
15
- * @example
16
- * const frakConfig: FrakWalletSdkConfig = {
17
- * metadata: {
18
- * name: "My app title",
19
- * },
20
- * }
21
- * const iframe = await createIframe({ config: frakConfig });
22
- * const client = createIFrameFrakClient({ config: frakConfig, iframe });
23
- */
24
- declare function createIFrameFrakClient({ config, iframe, }: {
25
- config: FrakWalletSdkConfig;
26
- iframe: HTMLIFrameElement;
27
- }): FrakClient;
28
-
29
- /**
30
- * Generic Frak RPC error
31
- * @ignore
32
- */
33
- declare class FrakRpcError<T = undefined> extends Error {
34
- code: number;
35
- data?: T | undefined;
36
- constructor(code: number, message: string, data?: T | undefined);
37
- }
38
- /** @ignore */
39
- declare class ClientNotFound extends FrakRpcError {
40
- constructor();
41
- }
42
- /**
43
- * The different Frak RPC error codes
44
- */
45
- declare const RpcErrorCodes: {
46
- readonly parseError: -32700;
47
- readonly invalidRequest: -32600;
48
- readonly methodNotFound: -32601;
49
- readonly invalidParams: -32602;
50
- readonly internalError: -32603;
51
- readonly serverError: -32000;
52
- readonly clientNotConnected: -32001;
53
- readonly configError: -32002;
54
- readonly corruptedResponse: -32003;
55
- readonly clientAborted: -32004;
56
- readonly walletNotConnected: -32005;
57
- readonly serverErrorForInteractionDelegation: -32006;
58
- };
59
-
60
- /**
61
- * The received encoded data from a client
62
- * -> The encoded should contain a HashProtectedData once decoded
63
- * @ignore
64
- */
65
- type CompressedData = Readonly<{
66
- compressed: string;
67
- compressedHash: string;
68
- }>;
69
- /**
70
- * The encoded data to send to a client / received by a client
71
- * @ignore
72
- */
73
- type HashProtectedData<DataType> = Readonly<DataType & {
74
- validationHash: string;
75
- }>;
76
- /**
77
- * Represent a key provider used for the hashed and secure compression
78
- * @ignore
79
- */
80
- type KeyProvider<DataType> = (value: DataType) => string[];
81
-
82
- /**
83
- * Directly setup the Frak client with an iframe
84
- * Return when the FrakClient is ready (setup and communication estbalished with the wallet)
85
- *
86
- * @param config - The configuration to use for the Frak Wallet SDK
87
- * @returns a Promise with the Frak Client
88
- *
89
- * @example
90
- * const frakConfig: FrakWalletSdkConfig = {
91
- * metadata: {
92
- * name: "My app title",
93
- * },
94
- * }
95
- * const client = await setupClient({ config: frakConfig });
96
- */
97
- declare function setupClient({ config, }: {
98
- config: FrakWalletSdkConfig;
99
- }): Promise<FrakClient | undefined>;
100
-
101
- /** @ignore */
102
- declare class DebugInfoGatherer {
103
- private config?;
104
- private iframe?;
105
- private isSetupDone;
106
- private lastResponse;
107
- private lastRequest;
108
- constructor(config?: FrakWalletSdkConfig, iframe?: HTMLIFrameElement);
109
- setLastResponse(event: MessageEvent<IFrameEvent>): void;
110
- setLastRequest(event: IFrameEvent, target: string): void;
111
- updateSetupStatus(status: boolean): void;
112
- private base64Encode;
113
- /**
114
- * Extract information from the iframe status
115
- */
116
- private getIframeStatus;
117
- private getNavigatorInfo;
118
- private gatherDebugInfo;
119
- static empty(): DebugInfoGatherer;
120
- /**
121
- * Format Frak debug information
122
- */
123
- formatDebugInfo(error: Error | unknown | string): string;
124
- }
125
-
126
- /**
127
- * Base props for the iframe
128
- * @ignore
129
- */
130
- declare const baseIframeProps: {
131
- id: string;
132
- name: string;
133
- allow: string;
134
- style: {
135
- width: string;
136
- height: string;
137
- border: string;
138
- position: string;
139
- zIndex: number;
140
- top: string;
141
- left: string;
142
- };
143
- };
144
- /**
145
- * Create the Frak iframe
146
- * @param args
147
- * @param args.walletBaseUrl - Use `config.walletUrl` instead. Will be removed in future versions.
148
- * @param args.config - The configuration object containing iframe options, including the replacement for `walletBaseUrl`.
149
- */
150
- declare function createIframe({ walletBaseUrl, config, }: {
151
- walletBaseUrl?: string;
152
- config?: FrakWalletSdkConfig;
153
- }): Promise<HTMLIFrameElement | undefined>;
154
-
155
- /**
156
- * Compress the given params, and add hash protection to (rapidly) prevent interception modification
157
- * @param data The params to encode
158
- * @ignore
159
- */
160
- declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
161
- /**
162
- * Compress json data
163
- * @param data
164
- * @ignore
165
- */
166
- declare function compressJson(data: unknown): Promise<string>;
167
-
168
- /**
169
- * Decompress the given string
170
- * @param compressedData The params to encode
171
- * @ignore
172
- */
173
- declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
174
- /**
175
- * Decompress json data
176
- * @param data
177
- * @ignore
178
- */
179
- declare function decompressJson<T>(data: string): Promise<T | null>;
180
-
181
- /**
182
- * Compress the current Frak context
183
- * @param context - The context to be compressed
184
- * @returns A compressed string containing the Frak context
185
- */
186
- declare function compress(context?: Partial<FrakContext>): string | undefined;
187
- /**
188
- * Decompress the given Frak context
189
- * @param context - The raw context to be decompressed into a `FrakContext`
190
- * @returns The decompressed Frak context, or undefined if it fails
191
- */
192
- declare function decompress(context?: string): FrakContext | undefined;
193
- /**
194
- * Parse the current URL into a Frak Context
195
- * @param args
196
- * @param args.url - The url to parse
197
- * @returns The parsed Frak context
198
- */
199
- declare function parse({ url }: {
200
- url: string;
201
- }): FrakContext | null | undefined;
202
- /**
203
- * Populate the current url with the given Frak context
204
- * @param args
205
- * @param args.url - The url to update
206
- * @param args.context - The context to update
207
- * @returns The new url with the Frak context
208
- */
209
- declare function update({ url, context, }: {
210
- url?: string;
211
- context: Partial<FrakContext>;
212
- }): string | null;
213
- /**
214
- * Remove Frak context from current url
215
- * @param url - The url to update
216
- * @returns The new url without the Frak context
217
- */
218
- declare function remove(url: string): string;
219
- /**
220
- * Replace the current url with the given Frak context
221
- * @param args
222
- * @param args.url - The url to update
223
- * @param args.context - The context to update
224
- */
225
- declare function replaceUrl({ url: baseUrl, context, }: {
226
- url?: string;
227
- context: Partial<FrakContext> | null;
228
- }): void;
229
- /**
230
- * Export our frak context "class"
231
- */
232
- declare const FrakContextManager: {
233
- compress: typeof compress;
234
- decompress: typeof decompress;
235
- parse: typeof parse;
236
- update: typeof update;
237
- remove: typeof remove;
238
- replaceUrl: typeof replaceUrl;
239
- };
240
-
241
- /**
242
- * Simple deferred promise wrapper
243
- * @ignore
244
- */
245
- declare class Deferred<T> {
246
- private readonly _promise;
247
- private _resolve;
248
- private _reject;
249
- constructor();
250
- get promise(): Promise<T>;
251
- resolve: (value: T | PromiseLike<T>) => void;
252
- reject: (reason?: unknown) => void;
253
- }
254
-
255
- export { ClientNotFound, type CompressedData, DebugInfoGatherer, Deferred, FrakClient, FrakContext, FrakContextManager, FrakRpcError, FrakWalletSdkConfig, type HashProtectedData, IFrameEvent, type KeyProvider, RpcErrorCodes, baseIframeProps, compressJson, createIFrameFrakClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, setupClient };
1
+ import type { Address } from 'viem';
2
+ import type { Hex } from 'viem';
3
+ import type { Prettify } from 'viem/chains';
4
+ import type { RpcSchema } from 'viem';
5
+ import type { SiweMessage } from 'viem/siwe';
6
+
7
+ /**
8
+ * Base props for the iframe
9
+ * @ignore
10
+ */
11
+ export declare const baseIframeProps: {
12
+ id: string;
13
+ name: string;
14
+ allow: string;
15
+ style: {
16
+ width: string;
17
+ height: string;
18
+ border: string;
19
+ position: string;
20
+ zIndex: number;
21
+ top: string;
22
+ left: string;
23
+ };
24
+ };
25
+
26
+ /**
27
+ * Event related to the iframe lifecycle
28
+ * @ignore
29
+ */
30
+ export declare type ClientLifecycleEvent = CustomCssEvent | RestoreBackupEvent | HearbeatEvent | HandshakeResponse;
31
+
32
+ /** @ignore */
33
+ export declare class ClientNotFound extends FrakRpcError {
34
+ constructor();
35
+ }
36
+
37
+ /**
38
+ * Compress the current Frak context
39
+ * @param context - The context to be compressed
40
+ * @returns A compressed string containing the Frak context
41
+ */
42
+ declare function compress(context?: Partial<FrakContext>): string | undefined;
43
+
44
+ /**
45
+ * The received encoded data from a client
46
+ * -> The encoded should contain a HashProtectedData once decoded
47
+ * @ignore
48
+ */
49
+ export declare type CompressedData = Readonly<{
50
+ compressed: string;
51
+ compressedHash: string;
52
+ }>;
53
+
54
+ /**
55
+ * Compress json data
56
+ * @param data
57
+ * @ignore
58
+ */
59
+ export declare function compressJson(data: unknown): Promise<string>;
60
+
61
+ /**
62
+ * Create the Frak iframe
63
+ * @param args
64
+ * @param args.walletBaseUrl - Use `config.walletUrl` instead. Will be removed in future versions.
65
+ * @param args.config - The configuration object containing iframe options, including the replacement for `walletBaseUrl`.
66
+ */
67
+ export declare function createIframe({ walletBaseUrl, config, }: {
68
+ walletBaseUrl?: string;
69
+ config?: FrakWalletSdkConfig;
70
+ }): Promise<HTMLIFrameElement | undefined>;
71
+
72
+ /**
73
+ * Create a new iframe Frak client
74
+ * @param args
75
+ * @param args.config - The configuration to use for the Frak Wallet SDK
76
+ * @param args.iframe - The iframe to use for the communication
77
+ * @returns The created Frak Client
78
+ *
79
+ * @example
80
+ * const frakConfig: FrakWalletSdkConfig = {
81
+ * metadata: {
82
+ * name: "My app title",
83
+ * },
84
+ * }
85
+ * const iframe = await createIframe({ config: frakConfig });
86
+ * const client = createIFrameFrakClient({ config: frakConfig, iframe });
87
+ */
88
+ export declare function createIFrameFrakClient({ config, iframe, }: {
89
+ config: FrakWalletSdkConfig;
90
+ iframe: HTMLIFrameElement;
91
+ }): FrakClient;
92
+
93
+ /**
94
+ * All the currencies available
95
+ */
96
+ export declare type Currency = "eur" | "usd" | "gbp";
97
+
98
+ declare type CustomCssEvent = {
99
+ clientLifecycle: "modal-css";
100
+ data: {
101
+ cssLink: string;
102
+ };
103
+ };
104
+
105
+ /** @ignore */
106
+ export declare class DebugInfoGatherer {
107
+ private config?;
108
+ private iframe?;
109
+ private isSetupDone;
110
+ private lastResponse;
111
+ private lastRequest;
112
+ constructor(config?: FrakWalletSdkConfig, iframe?: HTMLIFrameElement);
113
+ setLastResponse(event: MessageEvent<IFrameEvent>): void;
114
+ setLastRequest(event: IFrameEvent, target: string): void;
115
+ updateSetupStatus(status: boolean): void;
116
+ private base64Encode;
117
+ /**
118
+ * Extract information from the iframe status
119
+ */
120
+ private getIframeStatus;
121
+ private getNavigatorInfo;
122
+ private gatherDebugInfo;
123
+ static empty(): DebugInfoGatherer;
124
+ /**
125
+ * Format Frak debug information
126
+ */
127
+ formatDebugInfo(error: Error | unknown | string): string;
128
+ }
129
+
130
+ /**
131
+ * Decompress the given Frak context
132
+ * @param context - The raw context to be decompressed into a `FrakContext`
133
+ * @returns The decompressed Frak context, or undefined if it fails
134
+ */
135
+ declare function decompress(context?: string): FrakContext | undefined;
136
+
137
+ /**
138
+ * Decompress the given string
139
+ * @param compressedData The params to encode
140
+ * @ignore
141
+ */
142
+ export declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
143
+
144
+ /**
145
+ * Decompress json data
146
+ * @param data
147
+ * @ignore
148
+ */
149
+ export declare function decompressJson<T>(data: string): Promise<T | null>;
150
+
151
+ /**
152
+ * Simple deferred promise wrapper
153
+ * @ignore
154
+ */
155
+ export declare class Deferred<T> {
156
+ private readonly _promise;
157
+ private _resolve;
158
+ private _reject;
159
+ constructor();
160
+ get promise(): Promise<T>;
161
+ resolve: (value: T | PromiseLike<T>) => void;
162
+ reject: (reason?: unknown) => void;
163
+ }
164
+
165
+ /**
166
+ * The params used to display the embeded wallet
167
+ *
168
+ * @group Embeded wallet
169
+ */
170
+ export declare type DisplayEmbededWalletParamsType = {
171
+ /**
172
+ * The embeded view to display once the user is logged in
173
+ */
174
+ loggedIn?: LoggedInEmbededView;
175
+ /**
176
+ * The embeded view to display once the user is logged out
177
+ */
178
+ loggedOut?: LoggedOutEmbededView;
179
+ /**
180
+ * Some metadata to customise the embeded view
181
+ */
182
+ metadata?: {
183
+ /**
184
+ * The logo to display on the embeded wallet
185
+ * If undefined, will default to no logo displayed
186
+ */
187
+ logo?: string;
188
+ /**
189
+ * Link to the homepage of the calling website
190
+ * If unedfined, will default to the domain of the calling website
191
+ */
192
+ homepageLink?: string;
193
+ /**
194
+ * The target interaction behind this modal
195
+ */
196
+ targetInteraction?: FullInteractionTypesKey;
197
+ /**
198
+ * The position of the component
199
+ */
200
+ position?: "left" | "right";
201
+ };
202
+ };
203
+
204
+ /**
205
+ * Params used to display a modal
206
+ * @typeParam T - The list of modal steps we expect to have in the modal
207
+ * @group Modal Display
208
+ */
209
+ export declare type DisplayModalParamsType<T extends ModalStepTypes[]> = {
210
+ steps: ModalRpcStepsInput<T>;
211
+ metadata?: ModalRpcMetadata;
212
+ };
213
+
214
+ declare type DoBackupEvent = {
215
+ iframeLifecycle: "do-backup";
216
+ data: {
217
+ backup?: string;
218
+ };
219
+ };
220
+
221
+ /**
222
+ * The different type of action we can have on the embeded view (once the user is logged in)
223
+ *
224
+ * @group Embeded wallet
225
+ */
226
+ export declare type EmbededViewAction = {
227
+ key: "sharing";
228
+ /**
229
+ * Some sharing options
230
+ */
231
+ options?: {
232
+ /**
233
+ * The title that will be displayed on the system popup once the system sharing window is open
234
+ */
235
+ popupTitle?: string;
236
+ /**
237
+ * The text that will be shared alongside the link.
238
+ * Can contain the variable {LINK} to specify where the link is placed, otherwise it will be added at the end
239
+ */
240
+ text?: string;
241
+ /**
242
+ * The link to be shared (will be suffixed with the Frak sharing context)
243
+ */
244
+ link?: string;
245
+ };
246
+ };
247
+
248
+ /**
249
+ * Type that extract the possible return type from a RPC Schema
250
+ * @ignore
251
+ */
252
+ declare type ExtractedMethodFromRpc<TRpcSchema extends RpcSchema, TMethod extends ExtractedParametersFromRpc<TRpcSchema>["method"] = ExtractedParametersFromRpc<TRpcSchema>["method"]> = Extract<TRpcSchema[number], {
253
+ Method: TMethod;
254
+ }>;
255
+
256
+ /**
257
+ * Type that extract the possible parameters from a RPC Schema
258
+ * @ignore
259
+ */
260
+ export declare type ExtractedParametersFromRpc<TRpcSchema extends RpcSchema> = {
261
+ [K in keyof TRpcSchema]: Prettify<{
262
+ method: TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]["Method"] : string;
263
+ } & (TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]["Parameters"] extends undefined ? {
264
+ params?: never;
265
+ } : {
266
+ params: TRpcSchema[K]["Parameters"];
267
+ } : never)>;
268
+ }[number];
269
+
270
+ /**
271
+ * Type that extract the possible return type from a RPC Schema
272
+ * @ignore
273
+ */
274
+ export declare type ExtractedReturnTypeFromRpc<TRpcSchema extends RpcSchema, TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>> = ExtractedMethodFromRpc<TRpcSchema, TParameters["method"]>["ReturnType"];
275
+
276
+ /**
277
+ * The different types of final actions we can display in the final step
278
+ * @group Modal Display
279
+ */
280
+ export declare type FinalActionType = {
281
+ key: "sharing";
282
+ options?: {
283
+ popupTitle?: string;
284
+ text?: string;
285
+ link?: string;
286
+ };
287
+ } | {
288
+ key: "reward";
289
+ options?: never;
290
+ };
291
+
292
+ /**
293
+ * The final modal step type, could be used to display sharing options or a success reward screen.
294
+ *
295
+ * **Input**: What type final step to display?
296
+ * **Output**: None
297
+ *
298
+ * @group Modal Display
299
+ */
300
+ export declare type FinalModalStepType = GenericModalStepType<"final", {
301
+ dismissedMetadata?: ModalStepMetadata["metadata"];
302
+ action: FinalActionType;
303
+ autoSkip?: boolean;
304
+ }, object>;
305
+
306
+ export declare function formatAmount(amount: number, currency?: Currency): string;
307
+
308
+ /**
309
+ * Representing a Frak client, used to interact with the Frak Wallet
310
+ */
311
+ export declare type FrakClient = {
312
+ config: FrakWalletSdkConfig;
313
+ debugInfo: {
314
+ formatDebugInfo: (error: Error | unknown | string) => string;
315
+ };
316
+ } & IFrameTransport;
317
+
318
+ /**
319
+ * The current Frak Context
320
+ *
321
+ * For now, only contain a referrer address.
322
+ */
323
+ export declare type FrakContext = {
324
+ r: Address;
325
+ };
326
+
327
+ /**
328
+ * Export our frak context "class"
329
+ */
330
+ export declare const FrakContextManager: {
331
+ compress: typeof compress;
332
+ decompress: typeof decompress;
333
+ parse: typeof parse;
334
+ update: typeof update;
335
+ remove: typeof remove;
336
+ replaceUrl: typeof replaceUrl;
337
+ };
338
+
339
+ /**
340
+ * Generic Frak RPC error
341
+ * @ignore
342
+ */
343
+ export declare class FrakRpcError<T = undefined> extends Error {
344
+ code: number;
345
+ data?: T | undefined;
346
+ constructor(code: number, message: string, data?: T | undefined);
347
+ }
348
+
349
+ /**
350
+ * Configuration for the Nexus Wallet SDK
351
+ */
352
+ export declare type FrakWalletSdkConfig = {
353
+ /**
354
+ * The Frak wallet url
355
+ * @defaultValue "https://wallet.frak.id"
356
+ */
357
+ walletUrl?: string;
358
+ /**
359
+ * Some metadata about your implementation of the Frak SDK
360
+ */
361
+ metadata: {
362
+ /**
363
+ * Your application name (will be displayed in a few modals and in SSO)
364
+ */
365
+ name: string;
366
+ /**
367
+ * Custom CSS styles to apply to the modals and components
368
+ */
369
+ css?: string;
370
+ /**
371
+ * Language to display in the modal
372
+ * If undefined, will default to the browser language
373
+ */
374
+ lang?: "fr" | "en";
375
+ /**
376
+ * The currency to display in the modal
377
+ * @defaultValue `"eur"`
378
+ */
379
+ currency?: Currency;
380
+ };
381
+ /**
382
+ * The domain name of your application
383
+ * @defaultValue window.location.host
384
+ */
385
+ domain?: string;
386
+ };
387
+
388
+ /**
389
+ * The keys for each interaction types (e.g. `press.openArticle`) -> category_type.interaction_type
390
+ * @inline
391
+ */
392
+ export declare type FullInteractionTypesKey = {
393
+ [Category in keyof typeof interactionTypes]: `${Category & string}.${keyof (typeof interactionTypes)[Category] & string}`;
394
+ }[keyof typeof interactionTypes];
395
+
396
+ /**
397
+ * Represent a generic modal step type
398
+ * @ignore
399
+ * @inline
400
+ */
401
+ declare type GenericModalStepType<TKey, TParams, TReturns> = {
402
+ key: TKey;
403
+ params: TParams extends never ? ModalStepMetadata : ModalStepMetadata & TParams;
404
+ returns: TReturns;
405
+ };
406
+
407
+ /**
408
+ * Get the currency amount key for a given currency
409
+ * @param currency - The currency to use
410
+ * @returns The currency amount key
411
+ */
412
+ export declare function getCurrencyAmountKey(currency?: Currency): keyof TokenAmountType;
413
+
414
+ /**
415
+ * Response of the `frak_getProductInformation` RPC method
416
+ * @group RPC Schema
417
+ */
418
+ export declare type GetProductInformationReturnType = {
419
+ /**
420
+ * Current product id
421
+ */
422
+ id: Hex;
423
+ /**
424
+ * Some metadata
425
+ */
426
+ onChainMetadata: {
427
+ /**
428
+ * Name of the product on-chain
429
+ */
430
+ name: string;
431
+ /**
432
+ * Domain of the product on-chain
433
+ */
434
+ domain: string;
435
+ /**
436
+ * The supported product types
437
+ */
438
+ productTypes: ProductTypesKey[];
439
+ };
440
+ /**
441
+ * The max potential reward for the referrer
442
+ */
443
+ maxReferrer?: TokenAmountType;
444
+ /**
445
+ * The max potential reward for the referee
446
+ */
447
+ maxReferee?: TokenAmountType;
448
+ /**
449
+ * List of all the potentials reward arround this product
450
+ */
451
+ rewards: {
452
+ token: Address;
453
+ campaign: Address;
454
+ interactionTypeKey: FullInteractionTypesKey;
455
+ referrer: TokenAmountType;
456
+ referee: TokenAmountType;
457
+ }[];
458
+ };
459
+
460
+ /**
461
+ * Get the supported currency for a given currency
462
+ * @param currency - The currency to use
463
+ * @returns The supported currency
464
+ */
465
+ export declare function getSupportedCurrency(currency?: Currency): Currency;
466
+
467
+ /**
468
+ * Get the supported locale for a given currency
469
+ * @param currency - The currency to use
470
+ * @returns The supported locale
471
+ */
472
+ export declare function getSupportedLocale(currency?: Currency): (typeof locales)[LocalesKey];
473
+
474
+ declare type HandshakeRequestEvent = {
475
+ iframeLifecycle: "handshake";
476
+ data: {
477
+ token: string;
478
+ };
479
+ };
480
+
481
+ declare type HandshakeResponse = {
482
+ clientLifecycle: "handshake-response";
483
+ data: {
484
+ token: string;
485
+ currentUrl: string;
486
+ };
487
+ };
488
+
489
+ /**
490
+ * Compress the given params, and add hash protection to (rapidly) prevent interception modification
491
+ * @param data The params to encode
492
+ * @ignore
493
+ */
494
+ export declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
495
+
496
+ /**
497
+ * The encoded data to send to a client / received by a client
498
+ * @ignore
499
+ */
500
+ export declare type HashProtectedData<DataType> = Readonly<DataType & {
501
+ validationHash: string;
502
+ }>;
503
+
504
+ declare type HearbeatEvent = {
505
+ clientLifecycle: "heartbeat";
506
+ };
507
+
508
+ /**
509
+ * Represent an iframe event
510
+ */
511
+ export declare type IFrameEvent = IFrameRpcEvent | IFrameLifecycleEvent | ClientLifecycleEvent;
512
+
513
+ /**
514
+ * Event related to the iframe lifecycle
515
+ * @ignore
516
+ */
517
+ export declare type IFrameLifecycleEvent = {
518
+ iframeLifecycle: "connected" | "show" | "hide";
519
+ data?: never;
520
+ } | DoBackupEvent | RemoveBackupEvent | HandshakeRequestEvent;
521
+
522
+ /**
523
+ * Represent an iframe rpc event
524
+ */
525
+ export declare type IFrameRpcEvent = {
526
+ id: string;
527
+ topic: ExtractedParametersFromRpc<IFrameRpcSchema>["method"];
528
+ data: {
529
+ compressed: string;
530
+ compressedHash: string;
531
+ };
532
+ };
533
+
534
+ /**
535
+ * RPC interface that's used for the iframe communication
536
+ *
537
+ * Define all the methods available within the iFrame RPC client
538
+ *
539
+ * @group RPC Schema
540
+ *
541
+ * @remarks
542
+ * Here is the list of methods available:
543
+ *
544
+ * ### frak_listenToWalletStatus
545
+ * - Params: None
546
+ * - Returns: {@link WalletStatusReturnType}
547
+ *
548
+ * ### frak_displayModal
549
+ * - Params: [{@link ModalRpcStepsInput}, name: string, metadata?: {@link ModalRpcMetadata}]
550
+ * - Returns: {@link ModalRpcStepsResultType}
551
+ *
552
+ * ### frak_sendInteraction
553
+ * - Params: [productId: Hex, interaction: {@link PreparedInteraction}, signature?: Hex]
554
+ * - Returns: {@link SendInteractionReturnType}
555
+ *
556
+ * ### frak_sso
557
+ * - Params [params: {@link OpenSsoParamsType}, name: string, customCss?: string]
558
+ * - Returns: undefined
559
+ *
560
+ * ### frak_getProductInformation
561
+ * - Params: None
562
+ * - Returns: {@link GetProductInformationReturnType}
563
+ *
564
+ * ### frak_displayEmbededWallet
565
+ * - Params: [{@link DisplayEmbededWalletParamsType}]
566
+ * - Returns: undefined
567
+ */
568
+ export declare type IFrameRpcSchema = [
569
+ /**
570
+ * Method used to listen to the wallet status
571
+ */
572
+ {
573
+ Method: "frak_listenToWalletStatus";
574
+ Parameters?: undefined;
575
+ ReturnType: WalletStatusReturnType;
576
+ },
577
+ /**
578
+ * Method to display a modal with the provided steps
579
+ */
580
+ {
581
+ Method: "frak_displayModal";
582
+ Parameters: [
583
+ requests: ModalRpcStepsInput,
584
+ metadata: FrakWalletSdkConfig["metadata"] & ModalRpcMetadata
585
+ ];
586
+ ReturnType: ModalRpcStepsResultType;
587
+ },
588
+ /**
589
+ * Method to transmit a user interaction
590
+ */
591
+ {
592
+ Method: "frak_sendInteraction";
593
+ Parameters: [
594
+ productId: Hex,
595
+ interaction: PreparedInteraction,
596
+ signature?: Hex
597
+ ];
598
+ ReturnType: SendInteractionReturnType;
599
+ },
600
+ /**
601
+ * Method to start a SSO
602
+ * todo: Should also support direct tracking via a consumeKey
603
+ */
604
+ {
605
+ Method: "frak_sso";
606
+ Parameters: [
607
+ params: OpenSsoParamsType,
608
+ name: string,
609
+ customCss?: string
610
+ ];
611
+ ReturnType: undefined;
612
+ },
613
+ /**
614
+ * Method to get current product information's
615
+ * - Is product minted?
616
+ * - Does it have running campaign?
617
+ * - Estimated reward on actions
618
+ */
619
+ {
620
+ Method: "frak_getProductInformation";
621
+ Parameters?: undefined;
622
+ ReturnType: GetProductInformationReturnType;
623
+ },
624
+ /**
625
+ * Method to show the embeded wallet, with potential customisation
626
+ */
627
+ {
628
+ Method: "frak_displayEmbededWallet";
629
+ Parameters: [
630
+ DisplayEmbededWalletParamsType,
631
+ metadata: FrakWalletSdkConfig["metadata"]
632
+ ];
633
+ ReturnType: undefined;
634
+ }
635
+ ];
636
+
637
+ /**
638
+ * IFrame transport interface
639
+ */
640
+ export declare type IFrameTransport = {
641
+ /**
642
+ * Wait for the connection to be established
643
+ */
644
+ waitForConnection: Promise<boolean>;
645
+ /**
646
+ * Wait for the setup to be done
647
+ */
648
+ waitForSetup: Promise<void>;
649
+ /**
650
+ * Function used to perform a single request via the iframe transport
651
+ */
652
+ request: RequestFn<IFrameRpcSchema>;
653
+ /**
654
+ * Function used to listen to a request response via the iframe transport
655
+ */
656
+ listenerRequest: ListenerRequestFn<IFrameRpcSchema>;
657
+ /**
658
+ * Function used to destroy the iframe transport
659
+ */
660
+ destroy: () => Promise<void>;
661
+ };
662
+
663
+ /**
664
+ * Each interactions types according to the product types
665
+ */
666
+ export declare const interactionTypes: {
667
+ readonly press: {
668
+ readonly openArticle: "0xc0a24ffb";
669
+ readonly readArticle: "0xd5bd0fbe";
670
+ };
671
+ readonly dapp: {
672
+ readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
673
+ readonly callableVerifiableStorageUpdate: "0xa07da986";
674
+ };
675
+ readonly webshop: {
676
+ readonly open: "0xb311798f";
677
+ };
678
+ readonly referral: {
679
+ readonly referred: "0x010cc3b9";
680
+ readonly createLink: "0xb2c0f17c";
681
+ };
682
+ readonly purchase: {
683
+ readonly started: "0xd87e90c3";
684
+ readonly completed: "0x8403aeb4";
685
+ readonly unsafeCompleted: "0x4d5b14e0";
686
+ };
687
+ readonly retail: {
688
+ readonly customerMeeting: "0x74489004";
689
+ };
690
+ };
691
+
692
+ /**
693
+ * The final keys for each interaction types (e.g. `openArticle`) -> interaction type
694
+ * @inline
695
+ */
696
+ export declare type InteractionTypesKey = {
697
+ [K in keyof typeof interactionTypes]: keyof (typeof interactionTypes)[K];
698
+ }[keyof typeof interactionTypes];
699
+
700
+ /**
701
+ * Represent a key provider used for the hashed and secure compression
702
+ * @ignore
703
+ */
704
+ export declare type KeyProvider<DataType> = (value: DataType) => string[];
705
+
706
+ /**
707
+ * Type used for a listening request
708
+ * @inline
709
+ */
710
+ declare type ListenerRequestFn<TRpcSchema extends RpcSchema> = <TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>, _ReturnType = ExtractedReturnTypeFromRpc<TRpcSchema, TParameters>>(args: TParameters, callback: (result: _ReturnType) => void) => Promise<void>;
711
+
712
+ /**
713
+ * Map the currency to the locale
714
+ */
715
+ export declare const locales: {
716
+ readonly eur: "fr-FR";
717
+ readonly usd: "en-US";
718
+ readonly gbp: "en-GB";
719
+ };
720
+
721
+ /**
722
+ * The keys for each locales
723
+ * @inline
724
+ */
725
+ export declare type LocalesKey = keyof typeof locales;
726
+
727
+ /**
728
+ * Some configuration options for the embeded view
729
+ *
730
+ * @group Embeded wallet
731
+ */
732
+ export declare type LoggedInEmbededView = {
733
+ /**
734
+ * The main action to display on the logged in embeded view
735
+ * If none specified, the user will see his wallet with the activation button
736
+ */
737
+ action?: EmbededViewAction;
738
+ };
739
+
740
+ /**
741
+ * The view when a user is logged out
742
+ * @group Embeded wallet
743
+ */
744
+ export declare type LoggedOutEmbededView = {
745
+ /**
746
+ * Metadata option when displaying the embeded view
747
+ */
748
+ metadata?: {
749
+ /**
750
+ * The main CTA for the logged out view
751
+ * - can include some variable, available ones are:
752
+ * - {REWARD} -> The maximum reward a user can receive when itneracting on your website
753
+ * - can be formatted in markdown
754
+ *
755
+ * If not sert, it will default to a internalised message
756
+ */
757
+ text?: string;
758
+ /**
759
+ * The text that will be displayed on the login button
760
+ *
761
+ * If not set, it will default to a internalised message
762
+ */
763
+ buttonText?: string;
764
+ };
765
+ };
766
+
767
+ /**
768
+ * The login step for a Modal
769
+ *
770
+ * **Input**: Do we allow SSO or not? Is yes then the SSO metadata
771
+ * **Output**: The logged in wallet address
772
+ *
773
+ * @group Modal Display
774
+ */
775
+ export declare type LoginModalStepType = GenericModalStepType<"login", LoginWithSso | LoginWithoutSso, {
776
+ wallet: Address;
777
+ }>;
778
+
779
+ /** @inline */
780
+ declare type LoginWithoutSso = {
781
+ allowSso?: false;
782
+ ssoMetadata?: never;
783
+ };
784
+
785
+ /** @inline */
786
+ declare type LoginWithSso = {
787
+ allowSso: true;
788
+ ssoMetadata: SsoMetadata;
789
+ };
790
+
791
+ /**
792
+ * RPC metadata for the modal, used on top level modal configuration
793
+ * @group Modal Display
794
+ * @group RPC Schema
795
+ */
796
+ export declare type ModalRpcMetadata = {
797
+ header?: {
798
+ title?: string;
799
+ icon?: string;
800
+ };
801
+ context?: string;
802
+ targetInteraction?: FullInteractionTypesKey;
803
+ } & ({
804
+ isDismissible: true;
805
+ dismissActionTxt?: string;
806
+ } | {
807
+ isDismissible?: false;
808
+ dismissActionTxt?: never;
809
+ });
810
+
811
+ /**
812
+ * Type for the RPC input of a modal
813
+ * Just the `params` type of each `ModalStepTypes`
814
+ * @typeParam T - The list of modal steps we expect to have in the modal
815
+ * @group Modal Display
816
+ * @group RPC Schema
817
+ */
818
+ export declare type ModalRpcStepsInput<T extends ModalStepTypes[] = ModalStepTypes[]> = {
819
+ [K in T[number]["key"]]?: Extract<T[number], {
820
+ key: K;
821
+ }>["params"];
822
+ };
823
+
824
+ /**
825
+ * Type for the result of a modal request
826
+ * Just the `returns` type of each `ModalStepTypes`
827
+ * @typeParam T - The list of modal steps we expect to have in the modal
828
+ * @group Modal Display
829
+ * @group RPC Schema
830
+ */
831
+ export declare type ModalRpcStepsResultType<T extends ModalStepTypes[] = ModalStepTypes[]> = {
832
+ [K in T[number]["key"]]: Extract<T[number], {
833
+ key: K;
834
+ }>["returns"];
835
+ };
836
+
837
+ /**
838
+ * Metadata that can be used to customise a modal step
839
+ * @group Modal Display
840
+ */
841
+ export declare type ModalStepMetadata = {
842
+ metadata?: {
843
+ /**
844
+ * Custom title for the step
845
+ * If none provided, it will use an internationalised text
846
+ */
847
+ title?: string;
848
+ /**
849
+ * Custom description for the step
850
+ * If none provided, it will use an internationalised text
851
+ */
852
+ description?: string;
853
+ /**
854
+ * Custom text for the primary action of the step
855
+ * If none provided, it will use an internationalised text
856
+ */
857
+ primaryActionText?: string;
858
+ /**
859
+ * Custom text for the secondary action of the step
860
+ * If none provided, it will use an internationalised text
861
+ */
862
+ secondaryActionText?: string;
863
+ };
864
+ };
865
+
866
+ /**
867
+ * Generic type of steps we will display in the modal to the end user
868
+ * @group Modal Display
869
+ */
870
+ export declare type ModalStepTypes = LoginModalStepType | SiweAuthenticateModalStepType | SendTransactionModalStepType | OpenInteractionSessionModalStepType | FinalModalStepType;
871
+
872
+ /**
873
+ * The open interaction session step for a Modal
874
+ *
875
+ * **Input**: None
876
+ * **Output**: The interactions session period (start and end timestamp)
877
+ *
878
+ * @group Modal Display
879
+ */
880
+ export declare type OpenInteractionSessionModalStepType = GenericModalStepType<"openSession", object, OpenInteractionSessionReturnType>;
881
+
882
+ /**
883
+ * Return type of the open session modal step
884
+ * @inline
885
+ * @ignore
886
+ */
887
+ export declare type OpenInteractionSessionReturnType = {
888
+ startTimestamp: number;
889
+ endTimestamp: number;
890
+ };
891
+
892
+ /**
893
+ * Params to start a SSO
894
+ * @group RPC Schema
895
+ */
896
+ export declare type OpenSsoParamsType = {
897
+ /**
898
+ * Redirect URL after the SSO (optional)
899
+ */
900
+ redirectUrl?: string;
901
+ /**
902
+ * If the SSO should directly exit after completion
903
+ * @defaultValue true
904
+ */
905
+ directExit?: boolean;
906
+ /**
907
+ * Language of the SSO page (optional)
908
+ * It will default to the current user language (or "en" if unsupported language)
909
+ */
910
+ lang?: "en" | "fr";
911
+ /**
912
+ * Custom SSO metadata
913
+ */
914
+ metadata: SsoMetadata;
915
+ };
916
+
917
+ /**
918
+ * Parse the current URL into a Frak Context
919
+ * @param args
920
+ * @param args.url - The url to parse
921
+ * @returns The parsed Frak context
922
+ */
923
+ declare function parse({ url }: {
924
+ url: string;
925
+ }): FrakContext | null | undefined;
926
+
927
+ /**
928
+ * Represent a prepared user interaction, ready to be sent on-chain via the wallet
929
+ */
930
+ export declare type PreparedInteraction = {
931
+ handlerTypeDenominator: Hex;
932
+ interactionData: Hex;
933
+ };
934
+
935
+ /**
936
+ * List of the product types per denominator
937
+ */
938
+ export declare const productTypes: {
939
+ dapp: number;
940
+ press: number;
941
+ webshop: number;
942
+ retail: number;
943
+ referral: number;
944
+ purchase: number;
945
+ };
946
+
947
+ /**
948
+ * The keys for each product types
949
+ * @inline
950
+ */
951
+ export declare type ProductTypesKey = keyof typeof productTypes;
952
+
953
+ /**
954
+ * Bitmask for each product types
955
+ */
956
+ export declare const productTypesMask: Record<ProductTypesKey, bigint>;
957
+
958
+ /**
959
+ * Remove Frak context from current url
960
+ * @param url - The url to update
961
+ * @returns The new url without the Frak context
962
+ */
963
+ declare function remove(url: string): string;
964
+
965
+ declare type RemoveBackupEvent = {
966
+ iframeLifecycle: "remove-backup";
967
+ };
968
+
969
+ /**
970
+ * Replace the current url with the given Frak context
971
+ * @param args
972
+ * @param args.url - The url to update
973
+ * @param args.context - The context to update
974
+ */
975
+ declare function replaceUrl({ url: baseUrl, context, }: {
976
+ url?: string;
977
+ context: Partial<FrakContext> | null;
978
+ }): void;
979
+
980
+ /**
981
+ * Type used for a one shot request function
982
+ * @inline
983
+ */
984
+ declare type RequestFn<TRpcSchema extends RpcSchema> = <TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>, _ReturnType = ExtractedReturnTypeFromRpc<TRpcSchema, TParameters>>(args: TParameters) => Promise<_ReturnType>;
985
+
986
+ declare type RestoreBackupEvent = {
987
+ clientLifecycle: "restore-backup";
988
+ data: {
989
+ backup: string;
990
+ };
991
+ };
992
+
993
+ /**
994
+ * The different Frak RPC error codes
995
+ */
996
+ export declare const RpcErrorCodes: {
997
+ readonly parseError: -32700;
998
+ readonly invalidRequest: -32600;
999
+ readonly methodNotFound: -32601;
1000
+ readonly invalidParams: -32602;
1001
+ readonly internalError: -32603;
1002
+ readonly serverError: -32000;
1003
+ readonly clientNotConnected: -32001;
1004
+ readonly configError: -32002;
1005
+ readonly corruptedResponse: -32003;
1006
+ readonly clientAborted: -32004;
1007
+ readonly walletNotConnected: -32005;
1008
+ readonly serverErrorForInteractionDelegation: -32006;
1009
+ };
1010
+
1011
+ /**
1012
+ * Raw response that we will receive after an rpc request
1013
+ * @ignore
1014
+ */
1015
+ export declare type RpcResponse<TRpcSchema extends RpcSchema, TMethod extends TRpcSchema[number]["Method"] = TRpcSchema[number]["Method"]> = {
1016
+ result: Extract<TRpcSchema[number], {
1017
+ Method: TMethod;
1018
+ }>["ReturnType"];
1019
+ error?: never;
1020
+ } | {
1021
+ result?: never;
1022
+ error: {
1023
+ code: number;
1024
+ message: string;
1025
+ data?: unknown;
1026
+ };
1027
+ };
1028
+
1029
+ /**
1030
+ * Parameters that will be used to send an interaction to the blockchain
1031
+ * @inline
1032
+ */
1033
+ export declare type SendInteractionParamsType = {
1034
+ /**
1035
+ * The product id where this interaction has been made
1036
+ * @defaultValue keccak256(toHex(window.location.host))
1037
+ */
1038
+ productId?: Hex;
1039
+ /**
1040
+ * The prepared interaction, built from an Interaction Encoder
1041
+ */
1042
+ interaction: PreparedInteraction;
1043
+ /**
1044
+ * A pre-computed interaction signature
1045
+ * If none provided, the delegated interaction validator of your product will sign it (you can manage it in the business dashboard)
1046
+ *
1047
+ * @defaultValue undefined
1048
+ */
1049
+ validation?: Hex;
1050
+ };
1051
+
1052
+ /**
1053
+ * Return type of the send interaction rpc request
1054
+ * @group RPC Schema
1055
+ */
1056
+ export declare type SendInteractionReturnType = {
1057
+ /**
1058
+ * The id of the interaction in the interaction pool
1059
+ */
1060
+ delegationId: string;
1061
+ };
1062
+
1063
+ /**
1064
+ * The send transaction step for a Modal
1065
+ *
1066
+ * **Input**: Either a single tx or an array of tx to be sent
1067
+ * **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)
1068
+ *
1069
+ * @group Modal Display
1070
+ */
1071
+ export declare type SendTransactionModalStepType = GenericModalStepType<"sendTransaction", {
1072
+ tx: SendTransactionTxType | SendTransactionTxType[];
1073
+ }, SendTransactionReturnType>;
1074
+
1075
+ /**
1076
+ * Return type of the send transaction rpc request
1077
+ * @inline
1078
+ */
1079
+ export declare type SendTransactionReturnType = {
1080
+ hash: Hex;
1081
+ };
1082
+
1083
+ /**
1084
+ * Generic format representing a tx to be sent
1085
+ */
1086
+ export declare type SendTransactionTxType = {
1087
+ to: Address;
1088
+ data?: Hex;
1089
+ value?: Hex;
1090
+ };
1091
+
1092
+ /**
1093
+ * Directly setup the Frak client with an iframe
1094
+ * Return when the FrakClient is ready (setup and communication estbalished with the wallet)
1095
+ *
1096
+ * @param config - The configuration to use for the Frak Wallet SDK
1097
+ * @returns a Promise with the Frak Client
1098
+ *
1099
+ * @example
1100
+ * const frakConfig: FrakWalletSdkConfig = {
1101
+ * metadata: {
1102
+ * name: "My app title",
1103
+ * },
1104
+ * }
1105
+ * const client = await setupClient({ config: frakConfig });
1106
+ */
1107
+ export declare function setupClient({ config, }: {
1108
+ config: FrakWalletSdkConfig;
1109
+ }): Promise<FrakClient | undefined>;
1110
+
1111
+ /**
1112
+ * The SIWE authentication step for a Modal
1113
+ *
1114
+ * **Input**: SIWE message parameters
1115
+ * **Output**: SIWE result (message signed and wallet signature)
1116
+ *
1117
+ * @group Modal Display
1118
+ */
1119
+ export declare type SiweAuthenticateModalStepType = GenericModalStepType<"siweAuthenticate", {
1120
+ siwe: SiweAuthenticationParams;
1121
+ }, SiweAuthenticateReturnType>;
1122
+
1123
+ /**
1124
+ * Return type of the Siwe transaction rpc request
1125
+ * @inline
1126
+ */
1127
+ export declare type SiweAuthenticateReturnType = {
1128
+ signature: Hex;
1129
+ message: string;
1130
+ };
1131
+
1132
+ /**
1133
+ * Parameters used send a SIWE rpc request
1134
+ */
1135
+ export declare type SiweAuthenticationParams = Omit<SiweMessage, "address" | "chainId" | "expirationTime" | "issuedAt" | "notBefore"> & {
1136
+ expirationTimeTimestamp?: number;
1137
+ notBeforeTimestamp?: number;
1138
+ };
1139
+
1140
+ /**
1141
+ * SSO Metadata
1142
+ */
1143
+ export declare type SsoMetadata = {
1144
+ /**
1145
+ * URL to your client, if provided will be displayed in the SSO header
1146
+ */
1147
+ logoUrl?: string;
1148
+ /**
1149
+ * Link to your homepage, if referenced your app name will contain a link on the sso page
1150
+ */
1151
+ homepageLink?: string;
1152
+ };
1153
+
1154
+ /**
1155
+ * The type for the amount of tokens
1156
+ */
1157
+ export declare type TokenAmountType = {
1158
+ amount: number;
1159
+ eurAmount: number;
1160
+ usdAmount: number;
1161
+ gbpAmount: number;
1162
+ };
1163
+
1164
+ /**
1165
+ * Populate the current url with the given Frak context
1166
+ * @param args
1167
+ * @param args.url - The url to update
1168
+ * @param args.context - The context to update
1169
+ * @returns The new url with the Frak context
1170
+ */
1171
+ declare function update({ url, context, }: {
1172
+ url?: string;
1173
+ context: Partial<FrakContext>;
1174
+ }): string | null;
1175
+
1176
+ /**
1177
+ * @ignore
1178
+ * @inline
1179
+ */
1180
+ declare type WalletConnected = {
1181
+ key: "connected";
1182
+ wallet: Address;
1183
+ interactionToken?: string;
1184
+ interactionSession?: {
1185
+ startTimestamp: number;
1186
+ endTimestamp: number;
1187
+ };
1188
+ };
1189
+
1190
+ /**
1191
+ * @ignore
1192
+ * @inline
1193
+ */
1194
+ declare type WalletNotConnected = {
1195
+ key: "not-connected";
1196
+ wallet?: never;
1197
+ interactionToken?: never;
1198
+ interactionSession?: never;
1199
+ };
1200
+
1201
+ /**
1202
+ * RPC Response for the method `frak_listenToWalletStatus`
1203
+ * @group RPC Schema
1204
+ */
1205
+ export declare type WalletStatusReturnType = WalletConnected | WalletNotConnected;
1206
+
1207
+ export { }