@frak-labs/core-sdk 0.0.16 → 0.0.18-beta.27947565
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/cdn/bundle.js +5 -5
- package/dist/actions.cjs +1 -1
- package/dist/actions.d.cts +62 -60
- package/dist/actions.d.ts +62 -60
- package/dist/actions.js +1 -1
- package/dist/bundle.cjs +13 -0
- package/dist/bundle.d.cts +1927 -0
- package/dist/bundle.d.ts +1927 -0
- package/dist/bundle.js +13 -0
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +76 -172
- package/dist/index.d.ts +76 -172
- package/dist/index.js +2 -2
- package/dist/interactions.cjs +1 -1
- package/dist/interactions.js +1 -1
- package/package.json +23 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
2
|
import type { Hex } from 'viem';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { LifecycleMessage } from '@frak-labs/rpc';
|
|
4
|
+
import type { OpenPanel } from '@openpanel/web';
|
|
5
|
+
import type { RpcClient } from '@frak-labs/rpc';
|
|
6
|
+
import { RpcMessage } from '@frak-labs/rpc';
|
|
7
|
+
import { RpcResponse } from '@frak-labs/rpc';
|
|
5
8
|
import type { SiweMessage } from 'viem/siwe';
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -43,12 +46,7 @@ export declare const baseIframeProps: {
|
|
|
43
46
|
* Event related to the iframe lifecycle
|
|
44
47
|
* @ignore
|
|
45
48
|
*/
|
|
46
|
-
export declare type ClientLifecycleEvent = CustomCssEvent | CustomI18nEvent | RestoreBackupEvent | HearbeatEvent | HandshakeResponse;
|
|
47
|
-
|
|
48
|
-
/** @ignore */
|
|
49
|
-
export declare class ClientNotFound extends FrakRpcError {
|
|
50
|
-
constructor();
|
|
51
|
-
}
|
|
49
|
+
export declare type ClientLifecycleEvent = CustomCssEvent | CustomI18nEvent | RestoreBackupEvent | HearbeatEvent | HandshakeResponse | SsoRedirectCompleteEvent;
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
52
|
* Compress the current Frak context
|
|
@@ -64,13 +62,6 @@ declare function compress(context?: Partial<FrakContext>): string | undefined;
|
|
|
64
62
|
*/
|
|
65
63
|
export declare type CompressedData = Uint8Array;
|
|
66
64
|
|
|
67
|
-
/**
|
|
68
|
-
* Compress json data
|
|
69
|
-
* @param data
|
|
70
|
-
* @ignore
|
|
71
|
-
*/
|
|
72
|
-
export declare function compressJson(data: unknown): Uint8Array;
|
|
73
|
-
|
|
74
65
|
/**
|
|
75
66
|
* Compress json data
|
|
76
67
|
* @param data
|
|
@@ -138,8 +129,8 @@ export declare class DebugInfoGatherer {
|
|
|
138
129
|
private lastResponse;
|
|
139
130
|
private lastRequest;
|
|
140
131
|
constructor(config?: FrakWalletSdkConfig, iframe?: HTMLIFrameElement);
|
|
141
|
-
setLastResponse(
|
|
142
|
-
setLastRequest(event:
|
|
132
|
+
setLastResponse(message: RpcMessage, response: RpcResponse): void;
|
|
133
|
+
setLastRequest(event: RpcMessage): void;
|
|
143
134
|
updateSetupStatus(status: boolean): void;
|
|
144
135
|
private base64Encode;
|
|
145
136
|
/**
|
|
@@ -162,20 +153,6 @@ export declare class DebugInfoGatherer {
|
|
|
162
153
|
*/
|
|
163
154
|
declare function decompress(context?: string): FrakContext | undefined;
|
|
164
155
|
|
|
165
|
-
/**
|
|
166
|
-
* Decompress the given string
|
|
167
|
-
* @param compressedData The params to encode
|
|
168
|
-
* @ignore
|
|
169
|
-
*/
|
|
170
|
-
export declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): HashProtectedData<T>;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Decompress json data
|
|
174
|
-
* @param data
|
|
175
|
-
* @ignore
|
|
176
|
-
*/
|
|
177
|
-
export declare function decompressJson<T>(data: Uint8Array): T | null;
|
|
178
|
-
|
|
179
156
|
/**
|
|
180
157
|
* Decompress json data
|
|
181
158
|
* @param data
|
|
@@ -183,20 +160,6 @@ export declare function decompressJson<T>(data: Uint8Array): T | null;
|
|
|
183
160
|
*/
|
|
184
161
|
export declare function decompressJsonFromB64<T>(data: string): T | null;
|
|
185
162
|
|
|
186
|
-
/**
|
|
187
|
-
* Simple deferred promise wrapper
|
|
188
|
-
* @ignore
|
|
189
|
-
*/
|
|
190
|
-
export declare class Deferred<T> {
|
|
191
|
-
private readonly _promise;
|
|
192
|
-
private _resolve;
|
|
193
|
-
private _reject;
|
|
194
|
-
constructor();
|
|
195
|
-
get promise(): Promise<T>;
|
|
196
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
197
|
-
reject: (reason?: unknown) => void;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
163
|
/**
|
|
201
164
|
* The params used to display the embedded wallet
|
|
202
165
|
*
|
|
@@ -308,33 +271,7 @@ export declare type EmbeddedViewActionSharing = {
|
|
|
308
271
|
};
|
|
309
272
|
};
|
|
310
273
|
|
|
311
|
-
|
|
312
|
-
* Type that extract the possible return type from a RPC Schema
|
|
313
|
-
* @ignore
|
|
314
|
-
*/
|
|
315
|
-
declare type ExtractedMethodFromRpc<TRpcSchema extends RpcSchema, TMethod extends ExtractedParametersFromRpc<TRpcSchema>["method"] = ExtractedParametersFromRpc<TRpcSchema>["method"]> = Extract<TRpcSchema[number], {
|
|
316
|
-
Method: TMethod;
|
|
317
|
-
}>;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Type that extract the possible parameters from a RPC Schema
|
|
321
|
-
* @ignore
|
|
322
|
-
*/
|
|
323
|
-
export declare type ExtractedParametersFromRpc<TRpcSchema extends RpcSchema> = {
|
|
324
|
-
[K in keyof TRpcSchema]: Prettify<{
|
|
325
|
-
method: TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]["Method"] : string;
|
|
326
|
-
} & (TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]["Parameters"] extends undefined ? {
|
|
327
|
-
params?: never;
|
|
328
|
-
} : {
|
|
329
|
-
params: TRpcSchema[K]["Parameters"];
|
|
330
|
-
} : never)>;
|
|
331
|
-
}[number];
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Type that extract the possible return type from a RPC Schema
|
|
335
|
-
* @ignore
|
|
336
|
-
*/
|
|
337
|
-
export declare type ExtractedReturnTypeFromRpc<TRpcSchema extends RpcSchema, TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>> = ExtractedMethodFromRpc<TRpcSchema, TParameters["method"]>["ReturnType"];
|
|
274
|
+
declare type EventProps = Record<string, unknown>;
|
|
338
275
|
|
|
339
276
|
/**
|
|
340
277
|
* The different types of final actions we can display in the final step
|
|
@@ -382,6 +319,7 @@ export declare type FrakClient = {
|
|
|
382
319
|
debugInfo: {
|
|
383
320
|
formatDebugInfo: (error: Error | unknown | string) => string;
|
|
384
321
|
};
|
|
322
|
+
openPanel?: OpenPanel;
|
|
385
323
|
} & IFrameTransport;
|
|
386
324
|
|
|
387
325
|
/**
|
|
@@ -396,7 +334,7 @@ export declare type FrakContext = {
|
|
|
396
334
|
};
|
|
397
335
|
|
|
398
336
|
/**
|
|
399
|
-
* Export our frak context
|
|
337
|
+
* Export our frak context
|
|
400
338
|
*/
|
|
401
339
|
export declare const FrakContextManager: {
|
|
402
340
|
compress: typeof compress;
|
|
@@ -407,15 +345,12 @@ export declare const FrakContextManager: {
|
|
|
407
345
|
replaceUrl: typeof replaceUrl;
|
|
408
346
|
};
|
|
409
347
|
|
|
348
|
+
declare type FrakEvent = "share_button_clicked" | "wallet_button_clicked" | "share_modal_error" | "user_referred";
|
|
349
|
+
|
|
410
350
|
/**
|
|
411
|
-
*
|
|
412
|
-
* @ignore
|
|
351
|
+
* Represent an iframe event
|
|
413
352
|
*/
|
|
414
|
-
export declare
|
|
415
|
-
code: number;
|
|
416
|
-
data?: T | undefined;
|
|
417
|
-
constructor(code: number, message: string, data?: T | undefined);
|
|
418
|
-
}
|
|
353
|
+
export declare type FrakLifecycleEvent = IFrameLifecycleEvent | ClientLifecycleEvent;
|
|
419
354
|
|
|
420
355
|
/**
|
|
421
356
|
* Configuration for the Frak Wallet SDK
|
|
@@ -575,13 +510,6 @@ declare type HandshakeResponse = {
|
|
|
575
510
|
};
|
|
576
511
|
};
|
|
577
512
|
|
|
578
|
-
/**
|
|
579
|
-
* Compress the given params, and add hash protection to (rapidly) prevent interception modification
|
|
580
|
-
* @param data The params to encode
|
|
581
|
-
* @ignore
|
|
582
|
-
*/
|
|
583
|
-
export declare function hashAndCompressData<T>(data: T): CompressedData;
|
|
584
|
-
|
|
585
513
|
/**
|
|
586
514
|
* The encoded data to send to a client / received by a client
|
|
587
515
|
* @ignore
|
|
@@ -592,6 +520,7 @@ export declare type HashProtectedData<DataType> = Readonly<DataType & {
|
|
|
592
520
|
|
|
593
521
|
declare type HearbeatEvent = {
|
|
594
522
|
clientLifecycle: "heartbeat";
|
|
523
|
+
data?: never;
|
|
595
524
|
};
|
|
596
525
|
|
|
597
526
|
/**
|
|
@@ -629,66 +558,63 @@ declare type HearbeatEvent = {
|
|
|
629
558
|
*/
|
|
630
559
|
export declare type I18nConfig = Record<Language, LocalizedI18nConfig> | LocalizedI18nConfig;
|
|
631
560
|
|
|
632
|
-
/**
|
|
633
|
-
* Represent an iframe event
|
|
634
|
-
*/
|
|
635
|
-
export declare type IFrameEvent = IFrameRpcEvent | IFrameLifecycleEvent | ClientLifecycleEvent;
|
|
636
|
-
|
|
637
561
|
/**
|
|
638
562
|
* Event related to the iframe lifecycle
|
|
639
563
|
* @ignore
|
|
640
564
|
*/
|
|
641
565
|
export declare type IFrameLifecycleEvent = {
|
|
642
|
-
iframeLifecycle: "connected" | "show" | "hide";
|
|
566
|
+
iframeLifecycle: "connected" | "show" | "hide" | "remove-backup";
|
|
643
567
|
data?: never;
|
|
644
|
-
} | DoBackupEvent |
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Represent an iframe rpc event
|
|
648
|
-
*/
|
|
649
|
-
export declare type IFrameRpcEvent = {
|
|
650
|
-
id: string;
|
|
651
|
-
topic: ExtractedParametersFromRpc<IFrameRpcSchema>["method"];
|
|
652
|
-
data: CompressedData;
|
|
653
|
-
};
|
|
568
|
+
} | DoBackupEvent | HandshakeRequestEvent | RedirectRequestEvent;
|
|
654
569
|
|
|
655
570
|
/**
|
|
656
571
|
* RPC interface that's used for the iframe communication
|
|
657
572
|
*
|
|
658
|
-
* Define all the methods available within the iFrame RPC client
|
|
573
|
+
* Define all the methods available within the iFrame RPC client with response type annotations
|
|
659
574
|
*
|
|
660
575
|
* @group RPC Schema
|
|
661
576
|
*
|
|
662
577
|
* @remarks
|
|
663
|
-
*
|
|
578
|
+
* Each method in the schema now includes a ResponseType field that indicates:
|
|
579
|
+
* - "promise": One-shot request that resolves once
|
|
580
|
+
* - "stream": Streaming request that can emit multiple values
|
|
581
|
+
*
|
|
582
|
+
* ### Methods:
|
|
664
583
|
*
|
|
665
|
-
*
|
|
584
|
+
* #### frak_listenToWalletStatus
|
|
666
585
|
* - Params: None
|
|
667
586
|
* - Returns: {@link WalletStatusReturnType}
|
|
587
|
+
* - Response Type: stream (emits updates when wallet status changes)
|
|
668
588
|
*
|
|
669
|
-
*
|
|
670
|
-
* - Params: [{@link ModalRpcStepsInput},
|
|
589
|
+
* #### frak_displayModal
|
|
590
|
+
* - Params: [requests: {@link ModalRpcStepsInput}, metadata?: {@link ModalRpcMetadata}, configMetadata: {@link FrakWalletSdkConfig}["metadata"]]
|
|
671
591
|
* - Returns: {@link ModalRpcStepsResultType}
|
|
592
|
+
* - Response Type: promise (one-shot)
|
|
672
593
|
*
|
|
673
|
-
*
|
|
594
|
+
* #### frak_sendInteraction
|
|
674
595
|
* - Params: [productId: Hex, interaction: {@link PreparedInteraction}, signature?: Hex]
|
|
675
596
|
* - Returns: {@link SendInteractionReturnType}
|
|
597
|
+
* - Response Type: promise (one-shot)
|
|
676
598
|
*
|
|
677
|
-
*
|
|
678
|
-
* - Params [params: {@link OpenSsoParamsType}, name: string, customCss?: string]
|
|
679
|
-
* - Returns:
|
|
599
|
+
* #### frak_sso
|
|
600
|
+
* - Params: [params: {@link OpenSsoParamsType}, name: string, customCss?: string]
|
|
601
|
+
* - Returns: {@link OpenSsoReturnType}
|
|
602
|
+
* - Response Type: promise (one-shot)
|
|
680
603
|
*
|
|
681
|
-
*
|
|
604
|
+
* #### frak_getProductInformation
|
|
682
605
|
* - Params: None
|
|
683
606
|
* - Returns: {@link GetProductInformationReturnType}
|
|
607
|
+
* - Response Type: promise (one-shot)
|
|
684
608
|
*
|
|
685
|
-
*
|
|
686
|
-
* - Params: [{@link DisplayEmbeddedWalletParamsType}]
|
|
609
|
+
* #### frak_displayEmbeddedWallet
|
|
610
|
+
* - Params: [request: {@link DisplayEmbeddedWalletParamsType}, metadata: {@link FrakWalletSdkConfig}["metadata"]]
|
|
687
611
|
* - Returns: {@link DisplayEmbeddedWalletResultType}
|
|
612
|
+
* - Response Type: promise (one-shot)
|
|
688
613
|
*/
|
|
689
614
|
export declare type IFrameRpcSchema = [
|
|
690
615
|
/**
|
|
691
616
|
* Method used to listen to the wallet status
|
|
617
|
+
* This is a streaming method that emits updates when wallet status changes
|
|
692
618
|
*/
|
|
693
619
|
{
|
|
694
620
|
Method: "frak_listenToWalletStatus";
|
|
@@ -697,6 +623,7 @@ export declare type IFrameRpcSchema = [
|
|
|
697
623
|
},
|
|
698
624
|
/**
|
|
699
625
|
* Method to display a modal with the provided steps
|
|
626
|
+
* This is a one-shot request
|
|
700
627
|
*/
|
|
701
628
|
{
|
|
702
629
|
Method: "frak_displayModal";
|
|
@@ -709,6 +636,7 @@ export declare type IFrameRpcSchema = [
|
|
|
709
636
|
},
|
|
710
637
|
/**
|
|
711
638
|
* Method to transmit a user interaction
|
|
639
|
+
* This is a one-shot request
|
|
712
640
|
*/
|
|
713
641
|
{
|
|
714
642
|
Method: "frak_sendInteraction";
|
|
@@ -721,7 +649,7 @@ export declare type IFrameRpcSchema = [
|
|
|
721
649
|
},
|
|
722
650
|
/**
|
|
723
651
|
* Method to start a SSO
|
|
724
|
-
*
|
|
652
|
+
* This is a one-shot request
|
|
725
653
|
*/
|
|
726
654
|
{
|
|
727
655
|
Method: "frak_sso";
|
|
@@ -730,13 +658,14 @@ export declare type IFrameRpcSchema = [
|
|
|
730
658
|
name: string,
|
|
731
659
|
customCss?: string
|
|
732
660
|
];
|
|
733
|
-
ReturnType:
|
|
661
|
+
ReturnType: OpenSsoReturnType;
|
|
734
662
|
},
|
|
735
663
|
/**
|
|
736
664
|
* Method to get current product information's
|
|
737
665
|
* - Is product minted?
|
|
738
666
|
* - Does it have running campaign?
|
|
739
667
|
* - Estimated reward on actions
|
|
668
|
+
* This is a one-shot request
|
|
740
669
|
*/
|
|
741
670
|
{
|
|
742
671
|
Method: "frak_getProductInformation";
|
|
@@ -745,6 +674,7 @@ export declare type IFrameRpcSchema = [
|
|
|
745
674
|
},
|
|
746
675
|
/**
|
|
747
676
|
* Method to show the embedded wallet, with potential customization
|
|
677
|
+
* This is a one-shot request
|
|
748
678
|
*/
|
|
749
679
|
{
|
|
750
680
|
Method: "frak_displayEmbeddedWallet";
|
|
@@ -771,11 +701,11 @@ export declare type IFrameTransport = {
|
|
|
771
701
|
/**
|
|
772
702
|
* Function used to perform a single request via the iframe transport
|
|
773
703
|
*/
|
|
774
|
-
request:
|
|
704
|
+
request: RpcClient<IFrameRpcSchema, LifecycleMessage>["request"];
|
|
775
705
|
/**
|
|
776
706
|
* Function used to listen to a request response via the iframe transport
|
|
777
707
|
*/
|
|
778
|
-
listenerRequest:
|
|
708
|
+
listenerRequest: RpcClient<IFrameRpcSchema, LifecycleMessage>["listen"];
|
|
779
709
|
/**
|
|
780
710
|
* Function used to destroy the iframe transport
|
|
781
711
|
*/
|
|
@@ -831,12 +761,6 @@ export declare type KeyProvider<DataType> = (value: DataType) => string[];
|
|
|
831
761
|
*/
|
|
832
762
|
export declare type Language = "fr" | "en";
|
|
833
763
|
|
|
834
|
-
/**
|
|
835
|
-
* Type used for a listening request
|
|
836
|
-
* @inline
|
|
837
|
-
*/
|
|
838
|
-
declare type ListenerRequestFn<TRpcSchema extends RpcSchema> = <TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>, _ReturnType = ExtractedReturnTypeFromRpc<TRpcSchema, TParameters>>(args: TParameters, callback: (result: _ReturnType) => void) => Promise<void>;
|
|
839
|
-
|
|
840
764
|
/**
|
|
841
765
|
* Map the currency to the locale
|
|
842
766
|
*/
|
|
@@ -1051,6 +975,11 @@ export declare type OpenSsoParamsType = {
|
|
|
1051
975
|
* @defaultValue true
|
|
1052
976
|
*/
|
|
1053
977
|
directExit?: boolean;
|
|
978
|
+
/**
|
|
979
|
+
* If true, opens SSO in same window instead of popup
|
|
980
|
+
* Defaults to true when redirectUrl is provided, false otherwise
|
|
981
|
+
*/
|
|
982
|
+
openInSameWindow?: boolean;
|
|
1054
983
|
/**
|
|
1055
984
|
* Language of the SSO page (optional)
|
|
1056
985
|
* It will default to the current user language (or "en" if unsupported language)
|
|
@@ -1062,6 +991,17 @@ export declare type OpenSsoParamsType = {
|
|
|
1062
991
|
metadata: SsoMetadata;
|
|
1063
992
|
};
|
|
1064
993
|
|
|
994
|
+
/**
|
|
995
|
+
* Response after an SSO has been openned
|
|
996
|
+
*/
|
|
997
|
+
export declare type OpenSsoReturnType = {
|
|
998
|
+
/**
|
|
999
|
+
* Optional wallet address, returned when SSO completes via postMessage
|
|
1000
|
+
* Note: Only present when SSO flow completes (not immediately on open)
|
|
1001
|
+
*/
|
|
1002
|
+
wallet?: Hex;
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1065
1005
|
/**
|
|
1066
1006
|
* Parse the current URL into a Frak Context
|
|
1067
1007
|
* @param args
|
|
@@ -1107,7 +1047,8 @@ declare type RedirectRequestEvent = {
|
|
|
1107
1047
|
iframeLifecycle: "redirect";
|
|
1108
1048
|
data: {
|
|
1109
1049
|
/**
|
|
1110
|
-
* The base url to redirect to
|
|
1050
|
+
* The base url to redirect to
|
|
1051
|
+
* If it contain a query param `u`, the client need will suffix the current url to the base url
|
|
1111
1052
|
*/
|
|
1112
1053
|
baseRedirectUrl: string;
|
|
1113
1054
|
};
|
|
@@ -1120,10 +1061,6 @@ declare type RedirectRequestEvent = {
|
|
|
1120
1061
|
*/
|
|
1121
1062
|
declare function remove(url: string): string;
|
|
1122
1063
|
|
|
1123
|
-
declare type RemoveBackupEvent = {
|
|
1124
|
-
iframeLifecycle: "remove-backup";
|
|
1125
|
-
};
|
|
1126
|
-
|
|
1127
1064
|
/**
|
|
1128
1065
|
* Replace the current url with the given Frak context
|
|
1129
1066
|
* @param args
|
|
@@ -1135,12 +1072,6 @@ declare function replaceUrl({ url: baseUrl, context, }: {
|
|
|
1135
1072
|
context: Partial<FrakContext> | null;
|
|
1136
1073
|
}): void;
|
|
1137
1074
|
|
|
1138
|
-
/**
|
|
1139
|
-
* Type used for a one shot request function
|
|
1140
|
-
* @inline
|
|
1141
|
-
*/
|
|
1142
|
-
declare type RequestFn<TRpcSchema extends RpcSchema> = <TParameters extends ExtractedParametersFromRpc<TRpcSchema> = ExtractedParametersFromRpc<TRpcSchema>, _ReturnType = ExtractedReturnTypeFromRpc<TRpcSchema, TParameters>>(args: TParameters) => Promise<_ReturnType>;
|
|
1143
|
-
|
|
1144
1075
|
declare type RestoreBackupEvent = {
|
|
1145
1076
|
clientLifecycle: "restore-backup";
|
|
1146
1077
|
data: {
|
|
@@ -1148,42 +1079,6 @@ declare type RestoreBackupEvent = {
|
|
|
1148
1079
|
};
|
|
1149
1080
|
};
|
|
1150
1081
|
|
|
1151
|
-
/**
|
|
1152
|
-
* The different Frak RPC error codes
|
|
1153
|
-
*/
|
|
1154
|
-
export declare const RpcErrorCodes: {
|
|
1155
|
-
readonly parseError: -32700;
|
|
1156
|
-
readonly invalidRequest: -32600;
|
|
1157
|
-
readonly methodNotFound: -32601;
|
|
1158
|
-
readonly invalidParams: -32602;
|
|
1159
|
-
readonly internalError: -32603;
|
|
1160
|
-
readonly serverError: -32000;
|
|
1161
|
-
readonly clientNotConnected: -32001;
|
|
1162
|
-
readonly configError: -32002;
|
|
1163
|
-
readonly corruptedResponse: -32003;
|
|
1164
|
-
readonly clientAborted: -32004;
|
|
1165
|
-
readonly walletNotConnected: -32005;
|
|
1166
|
-
readonly serverErrorForInteractionDelegation: -32006;
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
/**
|
|
1170
|
-
* Raw response that we will receive after an rpc request
|
|
1171
|
-
* @ignore
|
|
1172
|
-
*/
|
|
1173
|
-
export declare type RpcResponse<TRpcSchema extends RpcSchema, TMethod extends TRpcSchema[number]["Method"] = TRpcSchema[number]["Method"]> = {
|
|
1174
|
-
result: Extract<TRpcSchema[number], {
|
|
1175
|
-
Method: TMethod;
|
|
1176
|
-
}>["ReturnType"];
|
|
1177
|
-
error?: never;
|
|
1178
|
-
} | {
|
|
1179
|
-
result?: never;
|
|
1180
|
-
error: {
|
|
1181
|
-
code: number;
|
|
1182
|
-
message: string;
|
|
1183
|
-
data?: unknown;
|
|
1184
|
-
};
|
|
1185
|
-
};
|
|
1186
|
-
|
|
1187
1082
|
/**
|
|
1188
1083
|
* Parameters that will be used to send an interaction to the blockchain
|
|
1189
1084
|
* @inline
|
|
@@ -1309,6 +1204,13 @@ export declare type SsoMetadata = {
|
|
|
1309
1204
|
homepageLink?: string;
|
|
1310
1205
|
};
|
|
1311
1206
|
|
|
1207
|
+
declare type SsoRedirectCompleteEvent = {
|
|
1208
|
+
clientLifecycle: "sso-redirect-complete";
|
|
1209
|
+
data: {
|
|
1210
|
+
compressed: string;
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1312
1214
|
/**
|
|
1313
1215
|
* The type for the amount of tokens
|
|
1314
1216
|
*/
|
|
@@ -1319,6 +1221,8 @@ export declare type TokenAmountType = {
|
|
|
1319
1221
|
gbpAmount: number;
|
|
1320
1222
|
};
|
|
1321
1223
|
|
|
1224
|
+
export declare function trackEvent(client: FrakClient | undefined, event: FrakEvent, props?: EventProps): void;
|
|
1225
|
+
|
|
1322
1226
|
/**
|
|
1323
1227
|
* Populate the current url with the given Frak context
|
|
1324
1228
|
* @param args
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{Deferred as e,FrakRpcError as t,RpcErrorCodes as n,compressJson as r,createRpcClient as a,decompressJson as o}from"@frak-labs/rpc";import{createClientCompressionMiddleware as i}from"@frak-labs/rpc/middleware";import{OpenPanel as s}from"@openpanel/web";import{bytesToHex as c,hexToBytes as l}from"viem";let d="nexus-wallet-backup";class u{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let n=this.getIframeStatus(),r=this.getNavigatorInfo(),a="Unknown";return e instanceof t?a=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?a=e.message:"string"==typeof e&&(a=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:n?this.base64Encode(n):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:a}}static empty(){return new u}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
|
|
2
2
|
Debug Information:
|
|
3
3
|
-----------------
|
|
4
4
|
Timestamp: ${t.timestamp}
|
|
@@ -10,4 +10,4 @@ import*as e from"@jsonjoy.com/json-pack/lib/cbor/index.js";import*as t from"viem
|
|
|
10
10
|
Last Response: ${t.lastResponse}
|
|
11
11
|
Client Status: ${t.clientStatus}
|
|
12
12
|
Error: ${t.error}
|
|
13
|
-
`.trim()}}let
|
|
13
|
+
`.trim()}}let f={id:"frak-wallet",name:"frak-wallet",title:"Frak Wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:2000001,top:"-1000px",left:"-1000px",colorScheme:"auto"}};function p({walletBaseUrl:e,config:t}){let n=document.querySelector("#frak-wallet");n&&n.remove();let r=document.createElement("iframe");return r.id=f.id,r.name=f.name,r.allow=f.allow,r.style.zIndex=f.style.zIndex.toString(),m({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function m({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function g({config:r,iframe:o}){let c,l=r?.walletUrl??"https://wallet.frak.id",f=function({iframe:t}){let n=new e;return{handleEvent:async e=>{if(!("iframeLifecycle"in e))return;let{iframeLifecycle:r,data:a}=e;switch(r){case"connected":n.resolve(!0);break;case"do-backup":a.backup?localStorage.setItem(d,a.backup):localStorage.removeItem(d);break;case"remove-backup":localStorage.removeItem(d);break;case"show":case"hide":m({iframe:t,isVisible:"show"===r});break;case"handshake":t.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:a.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(a.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=a.baseRedirectUrl}}},isConnected:n.promise}}({iframe:o}),p=new u(r,o);if(!o.contentWindow)throw new t(n.configError,"The iframe does not have a content window");let g=a({emittingTransport:o.contentWindow,listeningTransport:window,targetOrigin:l,middleware:[{async onRequest(e,r){if(!await f.isConnected)throw new t(n.clientNotConnected,"The iframe provider isn't connected yet");return r}},i(),{onRequest:(e,t)=>(p.setLastRequest(e),t),onResponse:(e,t)=>(p.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await f.handleEvent(e)}}}),w=function(e,t){let n,r,a=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function o(){n&&clearInterval(n),r&&clearTimeout(r)}return async function(){a(),n=setInterval(a,1e3),r=setTimeout(()=>{o(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,o()}(),o}(g,f),y=async()=>{w(),g.cleanup(),o.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(c=new s({apiUrl:"https://op-api.gcp.frak.id",clientId:"6eacc8d7-49ac-4936-95e9-81ef29449570",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.0.18"}),!0)})).setGlobalProperties({sdkVersion:"0.0.18"}),c.init();let b=h({config:r,rpcClient:g,lifecycleManager:f}).then(()=>p.updateSetupStatus(!0));return{config:r,debugInfo:p,waitForConnection:f.isConnected,waitForSetup:b,request:g.request,listenerRequest:g.listen,destroy:y,openPanel:c}}async function h({config:e,rpcClient:t,lifecycleManager:n}){async function r(){let n=e.customizations?.css;n&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:n}})}async function a(){let n=e.customizations?.i18n;n&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:n}})}async function o(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(d);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await n.isConnected,function(e,t){if("undefined"==typeof window)return;let n=new URL(window.location.href),r=n.searchParams.get("sso");r&&(t.then(()=>{e.sendLifecycle({clientLifecycle:"sso-redirect-complete",data:{compressed:r}}),console.log("[SSO URL Listener] Forwarded compressed SSO data to iframe")}).catch(e=>{console.error("[SSO URL Listener] Failed to forward SSO data:",e)}),n.searchParams.delete("sso"),window.history.replaceState({},"",n.toString()),console.log("[SSO URL Listener] SSO parameter detected and URL cleaned"))}(t,n.isConnected),await Promise.allSettled([r(),a(),o()])}let w={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function y(e){return e&&e in w?e:"eur"}async function b({config:e}){let t=function(e){let t=y(e.metadata?.currency);return{...e,metadata:{...e.metadata,currency:t}}}(e),n=await p({config:t});if(!n)return void console.error("Failed to create iframe");let r=g({config:t,iframe:n});return(await r.waitForSetup,await r.waitForConnection)?r:void console.error("Failed to connect to client")}function S(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function k(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0))}function L(e){return S(r(e))}function R(e){return o(k(e))}let v="fCtx";function x(e){if(e?.r)try{let t=l(e.r);return S(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function I(e){if(e&&0!==e.length)try{let t=k(e);return{r:c(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function F({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(v);return t?I(t):null}function C({url:e,context:t}){if(!e)return null;let n=F({url:e}),r=n?{...n,...t}:t;if(!r.r)return null;let a=x(r);if(!a)return null;let o=new URL(e);return o.searchParams.set(v,a),o.toString()}function U(e){let t=new URL(e);return t.searchParams.delete(v),t.toString()}let E={compress:x,decompress:I,parse:F,update:C,remove:U,replaceUrl:function({url:e,context:t}){let n;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let r=e??window.location.href;(n=null!==t?C({url:r,context:t}):U(r))&&window.history.replaceState(null,"",n.toString())}};function q(e){return e?w[e]??w.eur:w.eur}function D(e){return e?`${e}Amount`:"eurAmount"}function P(e,t){let n=q(t),r=y(t);return e.toLocaleString(n,{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}function $(e,t,n={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,n)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}let A={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},O=Object.entries(A).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{}),T={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}};export{u as DebugInfoGatherer,E as FrakContextManager,k as base64urlDecode,S as base64urlEncode,f as baseIframeProps,L as compressJsonToB64,g as createIFrameFrakClient,p as createIframe,R as decompressJsonFromB64,P as formatAmount,D as getCurrencyAmountKey,y as getSupportedCurrency,q as getSupportedLocale,T as interactionTypes,w as locales,A as productTypes,O as productTypesMask,b as setupClient,$ as trackEvent};
|
package/dist/interactions.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{
|
|
1
|
+
"use strict";let __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,r)=>{for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{PressInteractionEncoder:()=>PressInteractionEncoder,ReferralInteractionEncoder:()=>ReferralInteractionEncoder,RetailInteractionEncoder:()=>RetailInteractionEncoder,PurchaseInteractionEncoder:()=>PurchaseInteractionEncoder,WebShopInteractionEncoder:()=>WebShopInteractionEncoder});let external_viem_namespaceObject=require("viem"),interactionTypes={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}},productTypes={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},productTypesMask=Object.entries(productTypes).reduce((e,[r,t])=>(e[r]=BigInt(1)<<BigInt(t),e),{}),PressInteractionEncoder={openArticle({articleId:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.press.openArticle,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.press),interactionData:r}},readArticle({articleId:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.press.readArticle,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.press),interactionData:r}}},ReferralInteractionEncoder={createLink:()=>({handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.referral),interactionData:interactionTypes.referral.createLink}),referred({referrer:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.referral.referred,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.referral),interactionData:r}}},PurchaseInteractionEncoder={startPurchase({purchaseId:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.purchase.started,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.purchase),interactionData:r}},completedPurchase({purchaseId:e,proof:r}){let t=(0,external_viem_namespaceObject.encodeAbiParameters)([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),r]),a=(0,external_viem_namespaceObject.concatHex)([interactionTypes.purchase.completed,t]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.purchase),interactionData:a}},unsafeCompletedPurchase({purchaseId:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.purchase.unsafeCompleted,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.purchase),interactionData:r}}},WebShopInteractionEncoder={open:()=>({handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.webshop),interactionData:interactionTypes.webshop.open})},RetailInteractionEncoder={customerMeeting({agencyId:e}){let r=(0,external_viem_namespaceObject.concatHex)([interactionTypes.retail.customerMeeting,(0,external_viem_namespaceObject.pad)(e,{size:32})]);return{handlerTypeDenominator:(0,external_viem_namespaceObject.toHex)(productTypes.retail),interactionData:r}}};for(var __webpack_i__ in exports.PressInteractionEncoder=__webpack_exports__.PressInteractionEncoder,exports.PurchaseInteractionEncoder=__webpack_exports__.PurchaseInteractionEncoder,exports.ReferralInteractionEncoder=__webpack_exports__.ReferralInteractionEncoder,exports.RetailInteractionEncoder=__webpack_exports__.RetailInteractionEncoder,exports.WebShopInteractionEncoder=__webpack_exports__.WebShopInteractionEncoder,__webpack_exports__)-1===["PressInteractionEncoder","PurchaseInteractionEncoder","ReferralInteractionEncoder","RetailInteractionEncoder","WebShopInteractionEncoder"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
|
package/dist/interactions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{concatHex as e,encodeAbiParameters as r,pad as t,toHex as n}from"viem";let a="0xc0a24ffb",o="0xd5bd0fbe",i="0xb311798f",c="0x010cc3b9",l="0xb2c0f17c",p="0xd87e90c3",s="0x8403aeb4",d="0x4d5b14e0",h="0x74489004",u={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(u).reduce((e,[r,t])=>(e[r]=BigInt(1)<<BigInt(t),e),{});let m={openArticle({articleId:r}){let o=e([a,t(r,{size:32})]);return{handlerTypeDenominator:n(u.press),interactionData:o}},readArticle({articleId:r}){let a=e([o,t(r,{size:32})]);return{handlerTypeDenominator:n(u.press),interactionData:a}}},b={createLink:()=>({handlerTypeDenominator:n(u.referral),interactionData:l}),referred({referrer:r}){let a=e([c,t(r,{size:32})]);return{handlerTypeDenominator:n(u.referral),interactionData:a}}},f={startPurchase({purchaseId:r}){let a=e([p,t(r,{size:32})]);return{handlerTypeDenominator:n(u.purchase),interactionData:a}},completedPurchase({purchaseId:t,proof:a}){let o=r([{type:"uint256"},{type:"bytes32[]"}],[BigInt(t),a]),i=e([s,o]);return{handlerTypeDenominator:n(u.purchase),interactionData:i}},unsafeCompletedPurchase({purchaseId:r}){let a=e([d,t(r,{size:32})]);return{handlerTypeDenominator:n(u.purchase),interactionData:a}}},y={open:()=>({handlerTypeDenominator:n(u.webshop),interactionData:i})},D={customerMeeting({agencyId:r}){let a=e([h,t(r,{size:32})]);return{handlerTypeDenominator:n(u.retail),interactionData:a}}};export{m as PressInteractionEncoder,f as PurchaseInteractionEncoder,b as ReferralInteractionEncoder,D as RetailInteractionEncoder,y as WebShopInteractionEncoder};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.18-beta.27947565",
|
|
15
15
|
"description": "Core SDK of the Frak wallet, low level library to interact directly with the frak ecosystem.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"browser": "./cdn/bundle.js",
|
|
40
40
|
"exports": {
|
|
41
41
|
".": {
|
|
42
|
+
"development": "./src/index.ts",
|
|
42
43
|
"import": {
|
|
43
44
|
"types": "./dist/index.d.ts",
|
|
44
45
|
"default": "./dist/index.js"
|
|
@@ -49,6 +50,7 @@
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
"./actions": {
|
|
53
|
+
"development": "./src/actions/index.ts",
|
|
52
54
|
"import": {
|
|
53
55
|
"types": "./dist/actions.d.ts",
|
|
54
56
|
"default": "./dist/actions.js"
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
}
|
|
60
62
|
},
|
|
61
63
|
"./interactions": {
|
|
64
|
+
"development": "./src/interactions/index.ts",
|
|
62
65
|
"import": {
|
|
63
66
|
"types": "./dist/interactions.d.ts",
|
|
64
67
|
"default": "./dist/interactions.js"
|
|
@@ -67,6 +70,16 @@
|
|
|
67
70
|
"types": "./dist/interactions.d.cts",
|
|
68
71
|
"default": "./dist/interactions.cjs"
|
|
69
72
|
}
|
|
73
|
+
},
|
|
74
|
+
"./bundle": {
|
|
75
|
+
"import": {
|
|
76
|
+
"types": "./dist/bundle.d.ts",
|
|
77
|
+
"default": "./dist/bundle.js"
|
|
78
|
+
},
|
|
79
|
+
"require": {
|
|
80
|
+
"types": "./dist/bundle.d.cts",
|
|
81
|
+
"default": "./dist/bundle.cjs"
|
|
82
|
+
}
|
|
70
83
|
}
|
|
71
84
|
},
|
|
72
85
|
"scripts": {
|
|
@@ -85,14 +98,18 @@
|
|
|
85
98
|
"viem": "^2.23.14"
|
|
86
99
|
},
|
|
87
100
|
"dependencies": {
|
|
88
|
-
"@
|
|
101
|
+
"@frak-labs/rpc": "0.0.0",
|
|
102
|
+
"@jsonjoy.com/json-pack": "^1.2.0",
|
|
103
|
+
"@openpanel/web": "^1.0.1"
|
|
89
104
|
},
|
|
90
105
|
"devDependencies": {
|
|
91
|
-
"@arethetypeswrong/cli": "^0.
|
|
92
|
-
"@
|
|
106
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
107
|
+
"@frak-labs/dev-tooling": "0.0.0",
|
|
108
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
93
109
|
"@rsbuild/plugin-node-polyfill": "^1.3.0",
|
|
94
|
-
"@rslib/core": "^0.
|
|
95
|
-
"@types/node": "^
|
|
110
|
+
"@rslib/core": "^0.9.2",
|
|
111
|
+
"@types/node": "^24.0.1",
|
|
112
|
+
"dotenv": "^17.0.0",
|
|
96
113
|
"typescript": "^5.8.3"
|
|
97
114
|
},
|
|
98
115
|
"browserslist": [
|