@frak-labs/nexus-sdk 0.0.15 → 0.0.16

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 (34) hide show
  1. package/dist/{NexusContext-CSlCNW-G.d.cts → FrakContext-LbQht1ep.d.cts} +2 -2
  2. package/dist/{NexusContext-CSlCNW-G.d.ts → FrakContext-LbQht1ep.d.ts} +2 -2
  3. package/dist/bundle/bundle.js +3 -3
  4. package/dist/{chunk-C25NTD45.cjs → chunk-A3XYA7S7.cjs} +28 -14
  5. package/dist/{chunk-ARQTOP44.js → chunk-AHUMDUJC.js} +1 -1
  6. package/dist/{chunk-VMNURFPI.js → chunk-D77BTQYS.js} +19 -16
  7. package/dist/{chunk-4ADWI2GG.cjs → chunk-DAGCBEBQ.cjs} +18 -18
  8. package/dist/{chunk-KEATMEOW.cjs → chunk-FO2GFD5C.cjs} +26 -23
  9. package/dist/{chunk-2LAGZ6S5.js → chunk-FYMOOHMT.js} +35 -27
  10. package/dist/{chunk-K4FOGADW.js → chunk-HY6YATLS.js} +3 -1
  11. package/dist/{chunk-4LT3U3H4.cjs → chunk-J655X6YR.cjs} +38 -30
  12. package/dist/{chunk-I47XQDS3.js → chunk-TIKEZMSD.js} +16 -2
  13. package/dist/{chunk-DILTMQBI.cjs → chunk-UFJ7W6CQ.cjs} +3 -1
  14. package/dist/{client-B3Guoe3I.d.ts → client-ALy_TEwJ.d.ts} +28 -8
  15. package/dist/{client-Of9uIxuI.d.cts → client-DaEox5q4.d.cts} +28 -8
  16. package/dist/core/actions/index.cjs +5 -5
  17. package/dist/core/actions/index.d.cts +6 -7
  18. package/dist/core/actions/index.d.ts +6 -7
  19. package/dist/core/actions/index.js +4 -4
  20. package/dist/core/index.cjs +10 -4
  21. package/dist/core/index.d.cts +41 -9
  22. package/dist/core/index.d.ts +41 -9
  23. package/dist/core/index.js +11 -5
  24. package/dist/core/interactions/index.cjs +5 -3
  25. package/dist/core/interactions/index.d.cts +9 -1
  26. package/dist/core/interactions/index.d.ts +9 -1
  27. package/dist/core/interactions/index.js +6 -4
  28. package/dist/react/index.cjs +34 -34
  29. package/dist/react/index.d.cts +3 -3
  30. package/dist/react/index.d.ts +3 -3
  31. package/dist/react/index.js +16 -16
  32. package/dist/{sendTransaction-3d8jO9CJ.d.ts → sendTransaction-BOd-pvXr.d.ts} +2 -2
  33. package/dist/{sendTransaction-Cz6FoB9_.d.cts → sendTransaction-MhdJPTWd.d.cts} +2 -2
  34. package/package.json +3 -3
@@ -1,8 +1,8 @@
1
- import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-B3Guoe3I.js';
1
+ import { a as NexusClient, W as WalletStatusReturnType, M as ModalStepTypes, D as DisplayModalParamsType, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-ALy_TEwJ.js';
2
2
  import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-BngPoHA0.js';
3
- export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-3d8jO9CJ.js';
3
+ export { S as SendTransactionParams, a as SiweAuthenticateModalParams, b as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-BOd-pvXr.js';
4
4
  import { Hex } from 'viem';
5
- import { N as NexusContext } from '../../NexusContext-CSlCNW-G.js';
5
+ import { F as FrakContext } from '../../FrakContext-LbQht1ep.js';
6
6
  import 'viem/chains';
7
7
  import 'viem/siwe';
8
8
 
@@ -31,7 +31,6 @@ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(cli
31
31
 
32
32
  /**
33
33
  * Function used to open the SSO
34
- * todo: We are using the iframe here, since we need to send potentially load of datas, and it couldn't fit inside the query params of an url
35
34
  * @param client
36
35
  * @param args
37
36
  */
@@ -49,13 +48,13 @@ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-sessi
49
48
  * Automatically submit a referral interaction when detected
50
49
  * -> And automatically set the referral context in the url
51
50
  * @param walletStatus
52
- * @param nexusContext
51
+ * @param frakContext
53
52
  * @param modalConfig
54
53
  * @param productId
55
54
  */
56
- declare function processReferral(client: NexusClient, { walletStatus, nexusContext, modalConfig, productId, }: {
55
+ declare function processReferral(client: NexusClient, { walletStatus, frakContext, modalConfig, productId, }: {
57
56
  walletStatus?: WalletStatusReturnType;
58
- nexusContext?: Partial<NexusContext> | null;
57
+ frakContext?: Partial<FrakContext> | null;
59
58
  modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
60
59
  productId?: Hex;
61
60
  }): Promise<ReferralState>;
@@ -8,10 +8,10 @@ import {
8
8
  siweAuthenticate,
9
9
  walletStatus,
10
10
  watchWalletStatus
11
- } from "../../chunk-VMNURFPI.js";
12
- import "../../chunk-2LAGZ6S5.js";
13
- import "../../chunk-I47XQDS3.js";
14
- import "../../chunk-K4FOGADW.js";
11
+ } from "../../chunk-D77BTQYS.js";
12
+ import "../../chunk-FYMOOHMT.js";
13
+ import "../../chunk-TIKEZMSD.js";
14
+ import "../../chunk-HY6YATLS.js";
15
15
  export {
16
16
  displayModal,
17
17
  openSso,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
3
+ var _chunkDAGCBEBQcjs = require('../chunk-DAGCBEBQ.cjs');
4
4
 
5
5
 
6
6
 
@@ -8,15 +8,15 @@ var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
12
11
 
13
12
 
14
13
 
14
+ var _chunkJ655X6YRcjs = require('../chunk-J655X6YR.cjs');
15
15
 
16
- var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
17
16
 
18
17
 
19
18
 
19
+ var _chunkUFJ7W6CQcjs = require('../chunk-UFJ7W6CQ.cjs');
20
20
 
21
21
 
22
22
 
@@ -25,4 +25,10 @@ var _chunkDILTMQBIcjs = require('../chunk-DILTMQBI.cjs');
25
25
 
26
26
 
27
27
 
28
- exports.FrakRpcError = _chunk4LT3U3H4cjs.FrakRpcError; exports.NexusContextManager = _chunk4LT3U3H4cjs.NexusContextManager; exports.RpcErrorCodes = _chunk4LT3U3H4cjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunk4ADWI2GGcjs.createIFrameNexusClient; exports.createIframe = _chunk4LT3U3H4cjs.createIframe; exports.decompressDataAndCheckHash = _chunk4LT3U3H4cjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunk4LT3U3H4cjs.hashAndCompressData; exports.interactionTypes = _chunkDILTMQBIcjs.interactionTypes; exports.productTypes = _chunkDILTMQBIcjs.productTypes; exports.productTypesMask = _chunkDILTMQBIcjs.productTypesMask;
28
+
29
+
30
+
31
+
32
+
33
+
34
+ exports.Deferred = _chunkJ655X6YRcjs.Deferred; exports.FrakContextManager = _chunkJ655X6YRcjs.FrakContextManager; exports.FrakRpcError = _chunkJ655X6YRcjs.FrakRpcError; exports.RpcErrorCodes = _chunkJ655X6YRcjs.RpcErrorCodes; exports.compressJson = _chunkJ655X6YRcjs.compressJson; exports.createIFrameNexusClient = _chunkDAGCBEBQcjs.createIFrameNexusClient; exports.createIframe = _chunkJ655X6YRcjs.createIframe; exports.decompressDataAndCheckHash = _chunkJ655X6YRcjs.decompressDataAndCheckHash; exports.decompressJson = _chunkJ655X6YRcjs.decompressJson; exports.hashAndCompressData = _chunkJ655X6YRcjs.hashAndCompressData; exports.interactionTypes = _chunkUFJ7W6CQcjs.interactionTypes; exports.productTypes = _chunkUFJ7W6CQcjs.productTypes; exports.productTypesMask = _chunkUFJ7W6CQcjs.productTypesMask;
@@ -1,7 +1,7 @@
1
- import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-Of9uIxuI.cjs';
2
- export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, c as ModalRpcMetadata, d as ModalRpcStepsInput, e as ModalRpcStepsResultType, f as ModalStepMetadata, M as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, b as SsoMetadata, S as SuccessModalStepType, W as WalletStatusReturnType } from '../client-Of9uIxuI.cjs';
1
+ import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-DaEox5q4.cjs';
2
+ export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, n as FinalActionType, F as FinalModalStepType, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, b as ModalRpcMetadata, c as ModalRpcStepsInput, d as ModalRpcStepsResultType, e as ModalStepMetadata, M as ModalStepTypes, m as OpenInteractionSessionModalStepType, l as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, j as SendTransactionModalStepType, k as SendTransactionReturnType, i as SendTransactionTxType, f as SiweAuthenticateModalStepType, h as SiweAuthenticateReturnType, g as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType } from '../client-DaEox5q4.cjs';
3
3
  import { Address } from '../abi.js';
4
- import { N as NexusContext } from '../NexusContext-CSlCNW-G.cjs';
4
+ import { F as FrakContext } from '../FrakContext-LbQht1ep.cjs';
5
5
  export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
6
6
  export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.cjs';
7
7
  import 'viem';
@@ -48,12 +48,22 @@ declare function createIframe({ walletBaseUrl, }: {
48
48
  * @param data The params to encode
49
49
  */
50
50
  declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
51
+ /**
52
+ * Compress json data
53
+ * @param data
54
+ */
55
+ declare function compressJson(data: unknown): Promise<string>;
51
56
 
52
57
  /**
53
58
  * Decompress the given string
54
59
  * @param compressedData The params to encode
55
60
  */
56
61
  declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
62
+ /**
63
+ * Decompress json data
64
+ * @param data
65
+ */
66
+ declare function decompressJson<T>(data: string): Promise<T | null>;
57
67
 
58
68
  /**
59
69
  * Parse the current Nexus context in the given url
@@ -69,21 +79,41 @@ declare function parse({ url }: {
69
79
  */
70
80
  declare function update({ url, context, }: {
71
81
  url?: string;
72
- context: Partial<NexusContext>;
82
+ context: Partial<FrakContext>;
73
83
  }): Promise<string | null | undefined>;
84
+ /**
85
+ * Remove Nexus context from current url
86
+ */
87
+ declare function remove(url: string): string;
88
+ /**
89
+ * Replace the current url with the given Nexus context
90
+ * @param url
91
+ * @param context
92
+ */
74
93
  declare function replaceUrl({ url, context, }: {
75
94
  url?: string;
76
- context: Partial<NexusContext>;
95
+ context: Partial<FrakContext>;
77
96
  }): Promise<void>;
78
97
  /**
79
- * Export our nexus context "class"
98
+ * Export our frak context "class"
80
99
  */
81
- declare const NexusContextManager: {
100
+ declare const FrakContextManager: {
82
101
  parse: typeof parse;
83
102
  update: typeof update;
103
+ remove: typeof remove;
84
104
  replaceUrl: typeof replaceUrl;
85
105
  };
86
106
 
107
+ declare class Deferred<T> {
108
+ private readonly _promise;
109
+ private _resolve;
110
+ private _reject;
111
+ constructor();
112
+ get promise(): Promise<T>;
113
+ resolve: (value: T | PromiseLike<T>) => void;
114
+ reject: (reason?: unknown) => void;
115
+ }
116
+
87
117
  /**
88
118
  * The keys for each product types
89
119
  */
@@ -121,7 +151,9 @@ declare const interactionTypes: {
121
151
  readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
122
152
  readonly callableVerifiableStorageUpdate: "0xa07da986";
123
153
  };
124
- readonly webshop: {};
154
+ readonly webshop: {
155
+ readonly open: "0xb311798f";
156
+ };
125
157
  readonly referral: {
126
158
  readonly referred: "0x010cc3b9";
127
159
  readonly createLink: "0xb2c0f17c";
@@ -132,4 +164,4 @@ declare const interactionTypes: {
132
164
  };
133
165
  };
134
166
 
135
- export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusContextManager, NexusWalletSdkConfig, type ProductTypesKey, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
167
+ export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, type ProductTypesKey, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
@@ -1,7 +1,7 @@
1
- import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-B3Guoe3I.js';
2
- export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, c as ModalRpcMetadata, d as ModalRpcStepsInput, e as ModalRpcStepsResultType, f as ModalStepMetadata, M as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, k as SendTransactionModalStepType, l as SendTransactionReturnType, j as SendTransactionTxType, g as SiweAuthenticateModalStepType, i as SiweAuthenticateReturnType, h as SiweAuthenticationParams, b as SsoMetadata, S as SuccessModalStepType, W as WalletStatusReturnType } from '../client-B3Guoe3I.js';
1
+ import { N as NexusWalletSdkConfig, a as NexusClient } from '../client-ALy_TEwJ.js';
2
+ export { C as ClientLifecycleEvent, D as DisplayModalParamsType, E as ExtractedParametersFromRpc, s as ExtractedReturnTypeFromRpc, n as FinalActionType, F as FinalModalStepType, q as IFrameEvent, r as IFrameLifecycleEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, b as ModalRpcMetadata, c as ModalRpcStepsInput, d as ModalRpcStepsResultType, e as ModalStepMetadata, M as ModalStepTypes, m as OpenInteractionSessionModalStepType, l as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, j as SendTransactionModalStepType, k as SendTransactionReturnType, i as SendTransactionTxType, f as SiweAuthenticateModalStepType, h as SiweAuthenticateReturnType, g as SiweAuthenticationParams, S as SsoMetadata, W as WalletStatusReturnType } from '../client-ALy_TEwJ.js';
3
3
  import { Address } from '../abi.js';
4
- import { N as NexusContext } from '../NexusContext-CSlCNW-G.js';
4
+ import { F as FrakContext } from '../FrakContext-LbQht1ep.js';
5
5
  export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
6
6
  export { F as FrakRpcError, R as RpcErrorCodes } from '../error-Dflr3G5x.js';
7
7
  import 'viem';
@@ -48,12 +48,22 @@ declare function createIframe({ walletBaseUrl, }: {
48
48
  * @param data The params to encode
49
49
  */
50
50
  declare function hashAndCompressData<T>(data: T): Promise<CompressedData>;
51
+ /**
52
+ * Compress json data
53
+ * @param data
54
+ */
55
+ declare function compressJson(data: unknown): Promise<string>;
51
56
 
52
57
  /**
53
58
  * Decompress the given string
54
59
  * @param compressedData The params to encode
55
60
  */
56
61
  declare function decompressDataAndCheckHash<T>(compressedData: CompressedData): Promise<HashProtectedData<T>>;
62
+ /**
63
+ * Decompress json data
64
+ * @param data
65
+ */
66
+ declare function decompressJson<T>(data: string): Promise<T | null>;
57
67
 
58
68
  /**
59
69
  * Parse the current Nexus context in the given url
@@ -69,21 +79,41 @@ declare function parse({ url }: {
69
79
  */
70
80
  declare function update({ url, context, }: {
71
81
  url?: string;
72
- context: Partial<NexusContext>;
82
+ context: Partial<FrakContext>;
73
83
  }): Promise<string | null | undefined>;
84
+ /**
85
+ * Remove Nexus context from current url
86
+ */
87
+ declare function remove(url: string): string;
88
+ /**
89
+ * Replace the current url with the given Nexus context
90
+ * @param url
91
+ * @param context
92
+ */
74
93
  declare function replaceUrl({ url, context, }: {
75
94
  url?: string;
76
- context: Partial<NexusContext>;
95
+ context: Partial<FrakContext>;
77
96
  }): Promise<void>;
78
97
  /**
79
- * Export our nexus context "class"
98
+ * Export our frak context "class"
80
99
  */
81
- declare const NexusContextManager: {
100
+ declare const FrakContextManager: {
82
101
  parse: typeof parse;
83
102
  update: typeof update;
103
+ remove: typeof remove;
84
104
  replaceUrl: typeof replaceUrl;
85
105
  };
86
106
 
107
+ declare class Deferred<T> {
108
+ private readonly _promise;
109
+ private _resolve;
110
+ private _reject;
111
+ constructor();
112
+ get promise(): Promise<T>;
113
+ resolve: (value: T | PromiseLike<T>) => void;
114
+ reject: (reason?: unknown) => void;
115
+ }
116
+
87
117
  /**
88
118
  * The keys for each product types
89
119
  */
@@ -121,7 +151,9 @@ declare const interactionTypes: {
121
151
  readonly proofVerifiableStorageUpdate: "0x2ab2aeef";
122
152
  readonly callableVerifiableStorageUpdate: "0xa07da986";
123
153
  };
124
- readonly webshop: {};
154
+ readonly webshop: {
155
+ readonly open: "0xb311798f";
156
+ };
125
157
  readonly referral: {
126
158
  readonly referred: "0x010cc3b9";
127
159
  readonly createLink: "0xb2c0f17c";
@@ -132,4 +164,4 @@ declare const interactionTypes: {
132
164
  };
133
165
  };
134
166
 
135
- export { type CompressedData, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusContextManager, NexusWalletSdkConfig, type ProductTypesKey, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
167
+ export { type CompressedData, Deferred, FrakContextManager, type HashProtectedData, type InteractionTypesKey, type KeyProvider, NexusClient, NexusWalletSdkConfig, type ProductTypesKey, compressJson, createIFrameNexusClient, createIframe, decompressDataAndCheckHash, decompressJson, hashAndCompressData, interactionTypes, productTypes, productTypesMask };
@@ -1,26 +1,32 @@
1
1
  import {
2
2
  createIFrameNexusClient
3
- } from "../chunk-ARQTOP44.js";
3
+ } from "../chunk-AHUMDUJC.js";
4
4
  import {
5
+ Deferred,
6
+ FrakContextManager,
5
7
  FrakRpcError,
6
- NexusContextManager,
7
8
  RpcErrorCodes,
9
+ compressJson,
8
10
  createIframe,
9
11
  decompressDataAndCheckHash,
12
+ decompressJson,
10
13
  hashAndCompressData
11
- } from "../chunk-2LAGZ6S5.js";
14
+ } from "../chunk-FYMOOHMT.js";
12
15
  import {
13
16
  interactionTypes,
14
17
  productTypes,
15
18
  productTypesMask
16
- } from "../chunk-K4FOGADW.js";
19
+ } from "../chunk-HY6YATLS.js";
17
20
  export {
21
+ Deferred,
22
+ FrakContextManager,
18
23
  FrakRpcError,
19
- NexusContextManager,
20
24
  RpcErrorCodes,
25
+ compressJson,
21
26
  createIFrameNexusClient,
22
27
  createIframe,
23
28
  decompressDataAndCheckHash,
29
+ decompressJson,
24
30
  hashAndCompressData,
25
31
  interactionTypes,
26
32
  productTypes,
@@ -2,10 +2,12 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkC25NTD45cjs = require('../../chunk-C25NTD45.cjs');
6
- require('../../chunk-DILTMQBI.cjs');
7
5
 
6
+ var _chunkA3XYA7S7cjs = require('../../chunk-A3XYA7S7.cjs');
7
+ require('../../chunk-UFJ7W6CQ.cjs');
8
8
 
9
9
 
10
10
 
11
- exports.PressInteractionEncoder = _chunkC25NTD45cjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunkC25NTD45cjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunkC25NTD45cjs.ReferralInteractionEncoder;
11
+
12
+
13
+ exports.PressInteractionEncoder = _chunkA3XYA7S7cjs.PressInteractionEncoder; exports.PurchaseInteractionEncoder = _chunkA3XYA7S7cjs.PurchaseInteractionEncoder; exports.ReferralInteractionEncoder = _chunkA3XYA7S7cjs.ReferralInteractionEncoder; exports.WebShopInteractionEncoder = _chunkA3XYA7S7cjs.WebShopInteractionEncoder;
@@ -54,4 +54,12 @@ declare const PurchaseInteractionEncoder: {
54
54
  completedPurchase: typeof completedPurchase;
55
55
  };
56
56
 
57
- export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder };
57
+ /**
58
+ * Encode a create referral link interaction
59
+ */
60
+ declare function open(): PreparedInteraction;
61
+ declare const WebShopInteractionEncoder: {
62
+ open: typeof open;
63
+ };
64
+
65
+ export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, WebShopInteractionEncoder };
@@ -54,4 +54,12 @@ declare const PurchaseInteractionEncoder: {
54
54
  completedPurchase: typeof completedPurchase;
55
55
  };
56
56
 
57
- export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder };
57
+ /**
58
+ * Encode a create referral link interaction
59
+ */
60
+ declare function open(): PreparedInteraction;
61
+ declare const WebShopInteractionEncoder: {
62
+ open: typeof open;
63
+ };
64
+
65
+ export { PressInteractionEncoder, PurchaseInteractionEncoder, ReferralInteractionEncoder, WebShopInteractionEncoder };
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  PressInteractionEncoder,
3
3
  PurchaseInteractionEncoder,
4
- ReferralInteractionEncoder
5
- } from "../../chunk-I47XQDS3.js";
6
- import "../../chunk-K4FOGADW.js";
4
+ ReferralInteractionEncoder,
5
+ WebShopInteractionEncoder
6
+ } from "../../chunk-TIKEZMSD.js";
7
+ import "../../chunk-HY6YATLS.js";
7
8
  export {
8
9
  PressInteractionEncoder,
9
10
  PurchaseInteractionEncoder,
10
- ReferralInteractionEncoder
11
+ ReferralInteractionEncoder,
12
+ WebShopInteractionEncoder
11
13
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
3
+ var _chunkDAGCBEBQcjs = require('../chunk-DAGCBEBQ.cjs');
4
4
 
5
5
 
6
6
 
@@ -9,16 +9,16 @@ var _chunk4ADWI2GGcjs = require('../chunk-4ADWI2GG.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkKEATMEOWcjs = require('../chunk-KEATMEOW.cjs');
12
+ var _chunkFO2GFD5Ccjs = require('../chunk-FO2GFD5C.cjs');
13
13
 
14
14
 
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
20
- require('../chunk-C25NTD45.cjs');
21
- require('../chunk-DILTMQBI.cjs');
19
+ var _chunkJ655X6YRcjs = require('../chunk-J655X6YR.cjs');
20
+ require('../chunk-A3XYA7S7.cjs');
21
+ require('../chunk-UFJ7W6CQ.cjs');
22
22
 
23
23
  // src/react/provider/NexusConfigProvider.ts
24
24
  var _react = require('react');
@@ -50,8 +50,8 @@ function NexusConfigProvider(parameters) {
50
50
  function useNexusConfig() {
51
51
  const config = _react.useContext.call(void 0, NexusConfigContext);
52
52
  if (!config) {
53
- throw new (0, _chunk4LT3U3H4cjs.FrakRpcError)(
54
- _chunk4LT3U3H4cjs.RpcErrorCodes.configError,
53
+ throw new (0, _chunkJ655X6YRcjs.FrakRpcError)(
54
+ _chunkJ655X6YRcjs.RpcErrorCodes.configError,
55
55
  "Nexus config not found"
56
56
  );
57
57
  }
@@ -84,9 +84,9 @@ function useWalletStatus() {
84
84
  queryKey: ["nexus-sdk", "wallet-status-listener"],
85
85
  queryFn: async () => {
86
86
  if (!client) {
87
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
87
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
88
88
  }
89
- return _chunkKEATMEOWcjs.walletStatus.call(void 0, client, newStatusUpdated);
89
+ return _chunkFO2GFD5Ccjs.walletStatus.call(void 0, client, newStatusUpdated);
90
90
  },
91
91
  enabled: !!client
92
92
  });
@@ -103,9 +103,9 @@ function useSendTransactionAction({
103
103
  mutationKey: ["nexus-sdk", "send-transaction"],
104
104
  mutationFn: async (params) => {
105
105
  if (!client) {
106
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
106
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
107
107
  }
108
- return _chunkKEATMEOWcjs.sendTransaction.call(void 0, client, params);
108
+ return _chunkFO2GFD5Ccjs.sendTransaction.call(void 0, client, params);
109
109
  }
110
110
  });
111
111
  }
@@ -125,9 +125,9 @@ function useSiweAuthenticate({
125
125
  ],
126
126
  mutationFn: async (params) => {
127
127
  if (!client) {
128
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
128
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
129
129
  }
130
- return _chunkKEATMEOWcjs.siweAuthenticate.call(void 0, client, params);
130
+ return _chunkFO2GFD5Ccjs.siweAuthenticate.call(void 0, client, params);
131
131
  }
132
132
  });
133
133
  }
@@ -136,7 +136,7 @@ function useSiweAuthenticate({
136
136
 
137
137
 
138
138
 
139
- // src/react/hook/utils/useNexusContext.ts
139
+ // src/react/hook/utils/useFrakContext.ts
140
140
 
141
141
 
142
142
  // src/react/hook/utils/useWindowLocation.ts
@@ -175,14 +175,14 @@ function useWindowLocation() {
175
175
  return { location, href };
176
176
  }
177
177
 
178
- // src/react/hook/utils/useNexusContext.ts
179
- function useNexusContext() {
178
+ // src/react/hook/utils/useFrakContext.ts
179
+ function useFrakContext() {
180
180
  const { location } = useWindowLocation();
181
- const { data: nexusContext } = _reactquery.useQuery.call(void 0, {
181
+ const { data: frakContext } = _reactquery.useQuery.call(void 0, {
182
182
  queryKey: ["nexus-sdk", "context", _nullishCoalesce(_optionalChain([location, 'optionalAccess', _7 => _7.href]), () => ( "no-href"))],
183
183
  queryFn: async () => {
184
184
  if (!_optionalChain([location, 'optionalAccess', _8 => _8.href])) return null;
185
- return _chunk4LT3U3H4cjs.NexusContextManager.parse({ url: location.href });
185
+ return _chunkJ655X6YRcjs.FrakContextManager.parse({ url: location.href });
186
186
  },
187
187
  enabled: !!_optionalChain([location, 'optionalAccess', _9 => _9.href])
188
188
  });
@@ -190,14 +190,14 @@ function useNexusContext() {
190
190
  mutationKey: ["nexus-sdk", "update-context"],
191
191
  mutationFn: async (newContext) => {
192
192
  console.log("Updating context", { newContext });
193
- await _chunk4LT3U3H4cjs.NexusContextManager.replaceUrl({
193
+ await _chunkJ655X6YRcjs.FrakContextManager.replaceUrl({
194
194
  url: _optionalChain([location, 'optionalAccess', _10 => _10.href]),
195
195
  context: newContext
196
196
  });
197
197
  }
198
198
  });
199
199
  return {
200
- nexusContext,
200
+ frakContext,
201
201
  updateContext,
202
202
  updateContextAsync
203
203
  };
@@ -209,7 +209,7 @@ function useReferralInteraction({
209
209
  modalConfig
210
210
  } = {}) {
211
211
  const client = useNexusClient();
212
- const { nexusContext } = useNexusContext();
212
+ const { frakContext } = useFrakContext();
213
213
  const { data: walletStatus2 } = useWalletStatus();
214
214
  const {
215
215
  data: referralState,
@@ -221,17 +221,17 @@ function useReferralInteraction({
221
221
  queryKey: [
222
222
  "nexus-sdk",
223
223
  "auto-referral-interaction",
224
- _nullishCoalesce(_optionalChain([nexusContext, 'optionalAccess', _11 => _11.r]), () => ( "no-referrer")),
224
+ _nullishCoalesce(_optionalChain([frakContext, 'optionalAccess', _11 => _11.r]), () => ( "no-referrer")),
225
225
  _nullishCoalesce(_optionalChain([walletStatus2, 'optionalAccess', _12 => _12.key]), () => ( "no-wallet-status")),
226
226
  _nullishCoalesce(productId, () => ( "no-product-id"))
227
227
  ],
228
228
  queryFn: () => {
229
229
  if (!client) {
230
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
230
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
231
231
  }
232
- return _chunkKEATMEOWcjs.processReferral.call(void 0, client, {
232
+ return _chunkFO2GFD5Ccjs.processReferral.call(void 0, client, {
233
233
  walletStatus: walletStatus2,
234
- nexusContext,
234
+ frakContext,
235
235
  modalConfig,
236
236
  productId
237
237
  });
@@ -256,9 +256,9 @@ function useSendInteraction({
256
256
  mutationKey: ["nexus-sdk", "send-interaction"],
257
257
  mutationFn: async (params) => {
258
258
  if (!client) {
259
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
259
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
260
260
  }
261
- return _chunkKEATMEOWcjs.sendInteraction.call(void 0, client, params);
261
+ return _chunkFO2GFD5Ccjs.sendInteraction.call(void 0, client, params);
262
262
  }
263
263
  });
264
264
  }
@@ -274,9 +274,9 @@ function useDisplayModal({
274
274
  mutationKey: ["nexus-sdk", "display-modal"],
275
275
  mutationFn: async (args) => {
276
276
  if (!client) {
277
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
277
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
278
278
  }
279
- return _chunkKEATMEOWcjs.displayModal.call(void 0, client, args);
279
+ return _chunkFO2GFD5Ccjs.displayModal.call(void 0, client, args);
280
280
  }
281
281
  });
282
282
  }
@@ -290,9 +290,9 @@ function useOpenSso({ mutations } = {}) {
290
290
  mutationKey: ["nexus-sdk", "open-sso"],
291
291
  mutationFn: async (params) => {
292
292
  if (!client) {
293
- throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
293
+ throw new (0, _chunkJ655X6YRcjs.ClientNotFound)();
294
294
  }
295
- return _chunkKEATMEOWcjs.openSso.call(void 0, client, params);
295
+ return _chunkFO2GFD5Ccjs.openSso.call(void 0, client, params);
296
296
  }
297
297
  });
298
298
  }
@@ -308,15 +308,15 @@ function NexusIFrameClientProvider({
308
308
  const config = useNexusConfig();
309
309
  const [client, setClient] = _react.useState.call(void 0, void 0);
310
310
  const iFrame = _react.createElement.call(void 0, "iframe", {
311
- ..._chunk4LT3U3H4cjs.baseIframeProps,
311
+ ..._chunkJ655X6YRcjs.baseIframeProps,
312
312
  src: `${config.walletUrl}/listener`,
313
- style: _nullishCoalesce(style, () => ( _chunk4LT3U3H4cjs.baseIframeProps.style)),
313
+ style: _nullishCoalesce(style, () => ( _chunkJ655X6YRcjs.baseIframeProps.style)),
314
314
  ref: (iframe) => {
315
315
  if (!iframe || client) {
316
316
  return;
317
317
  }
318
318
  setClient(
319
- _chunk4ADWI2GGcjs.createIFrameNexusClient.call(void 0, {
319
+ _chunkDAGCBEBQcjs.createIFrameNexusClient.call(void 0, {
320
320
  iframe,
321
321
  config
322
322
  })
@@ -1,12 +1,12 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
3
- import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, l as SendTransactionReturnType, i as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../client-Of9uIxuI.cjs';
3
+ import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../client-DaEox5q4.cjs';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseMutationOptions } from '@tanstack/react-query';
6
6
  import * as viem from 'viem';
7
7
  import { Hex } from 'viem';
8
8
  import { F as FrakRpcError } from '../error-Dflr3G5x.cjs';
9
- import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-Cz6FoB9_.cjs';
9
+ import { S as SendTransactionParams, a as SiweAuthenticateModalParams } from '../sendTransaction-MhdJPTWd.cjs';
10
10
  import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
11
11
  import 'viem/chains';
12
12
  import 'viem/siwe';
@@ -121,7 +121,7 @@ declare function useSiweAuthenticate({ mutations, }?: UseSiweAuthenticateParams)
121
121
  declare function useReferralInteraction({ productId, modalConfig, }?: {
122
122
  productId?: Hex;
123
123
  modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
124
- }): Error | ("success" | "error" | "idle" | "processing" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
124
+ }): Error | ("error" | "idle" | "processing" | "success" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
125
125
 
126
126
  type MutationOptions$2 = Omit<UseMutationOptions<SendInteractionReturnType, FrakRpcError, SendInteractionParamsType>, "mutationFn" | "mutationKey">;
127
127
  interface UseSendInteractionParams$1 {
@@ -1,12 +1,12 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
3
- import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, l as SendTransactionReturnType, i as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../client-B3Guoe3I.js';
3
+ import { N as NexusWalletSdkConfig, a as NexusClient, W as WalletStatusReturnType, k as SendTransactionReturnType, h as SiweAuthenticateReturnType, D as DisplayModalParamsType, M as ModalStepTypes, d as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../client-ALy_TEwJ.js';
4
4
  import * as _tanstack_react_query from '@tanstack/react-query';
5
5
  import { UseMutationOptions } from '@tanstack/react-query';
6
6
  import * as viem from 'viem';
7
7
  import { Hex } from 'viem';
8
8
  import { F as FrakRpcError } from '../error-Dflr3G5x.js';
9
- import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-3d8jO9CJ.js';
9
+ import { S as SendTransactionParams, a as SiweAuthenticateModalParams } from '../sendTransaction-BOd-pvXr.js';
10
10
  import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
11
11
  import 'viem/chains';
12
12
  import 'viem/siwe';
@@ -121,7 +121,7 @@ declare function useSiweAuthenticate({ mutations, }?: UseSiweAuthenticateParams)
121
121
  declare function useReferralInteraction({ productId, modalConfig, }?: {
122
122
  productId?: Hex;
123
123
  modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
124
- }): Error | ("success" | "error" | "idle" | "processing" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
124
+ }): Error | ("error" | "idle" | "processing" | "success" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
125
125
 
126
126
  type MutationOptions$2 = Omit<UseMutationOptions<SendInteractionReturnType, FrakRpcError, SendInteractionParamsType>, "mutationFn" | "mutationKey">;
127
127
  interface UseSendInteractionParams$1 {