@frak-labs/nexus-sdk 0.0.10 → 0.0.11

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 (37) hide show
  1. package/dist/chunk-5CFD5FM2.js +86 -0
  2. package/dist/chunk-7MVQQ2X6.js +381 -0
  3. package/dist/{chunk-72IEHEQX.js → chunk-GUDT2W6I.js} +32 -10
  4. package/dist/{chunk-NIFJZD3M.cjs → chunk-IQQTTKJL.cjs} +30 -8
  5. package/dist/chunk-S5FVCA2E.cjs +86 -0
  6. package/dist/chunk-V3S6RBRJ.cjs +381 -0
  7. package/dist/{client-6_BJp7Ub.d.ts → client-C7u9zGwC.d.cts} +135 -142
  8. package/dist/{client--U_6SK0l.d.cts → client-gE3fYzkD.d.ts} +135 -142
  9. package/dist/core/actions/index.cjs +2 -7
  10. package/dist/core/actions/index.d.cts +16 -35
  11. package/dist/core/actions/index.d.ts +16 -35
  12. package/dist/core/actions/index.js +5 -10
  13. package/dist/core/index.cjs +2 -4
  14. package/dist/core/index.d.cts +3 -3
  15. package/dist/core/index.d.ts +3 -3
  16. package/dist/core/index.js +2 -4
  17. package/dist/core/interactions/index.cjs +6 -2
  18. package/dist/core/interactions/index.d.cts +20 -6
  19. package/dist/core/interactions/index.d.ts +20 -6
  20. package/dist/core/interactions/index.js +7 -3
  21. package/dist/{interaction-D_CzyqRE.d.cts → interaction-D3-M3nBh.d.cts} +2 -2
  22. package/dist/{interaction-D_CzyqRE.d.ts → interaction-D3-M3nBh.d.ts} +2 -2
  23. package/dist/react/index.cjs +146 -158
  24. package/dist/react/index.d.cts +44 -51
  25. package/dist/react/index.d.ts +44 -51
  26. package/dist/react/index.js +152 -164
  27. package/dist/sendTransaction-BZW627cT.d.cts +30 -0
  28. package/dist/sendTransaction-DpJTfGJc.d.ts +30 -0
  29. package/package.json +8 -5
  30. package/dist/chunk-3T2FNW6E.cjs +0 -100
  31. package/dist/chunk-BPFJZRJ6.cjs +0 -152
  32. package/dist/chunk-HOX3RRO6.js +0 -199
  33. package/dist/chunk-SGLR6RFA.cjs +0 -199
  34. package/dist/chunk-T54VMWHQ.js +0 -100
  35. package/dist/chunk-TPC5PMRC.js +0 -152
  36. package/dist/watchUnlockStatus-CxnibdQx.d.cts +0 -43
  37. package/dist/watchUnlockStatus-g8wIxpeM.d.ts +0 -43
@@ -1,7 +1,7 @@
1
- import { Hex, Address, RpcSchema } from 'viem';
1
+ import { Address, Hex, RpcSchema } from 'viem';
2
2
  import { Prettify } from 'viem/chains';
3
3
  import { SiweMessage } from 'viem/siwe';
4
- import { P as PreparedInteraction, a as SendInteractionReturnType } from './interaction-D_CzyqRE.cjs';
4
+ import { P as PreparedInteraction, a as SendInteractionReturnType } from './interaction-D3-M3nBh.js';
5
5
 
6
6
  /**
7
7
  * Configuration for the Nexus Wallet SDK
@@ -10,21 +10,70 @@ type NexusWalletSdkConfig = Readonly<{
10
10
  walletUrl: string;
11
11
  metadata: {
12
12
  name: string;
13
+ css?: string;
13
14
  };
14
15
  domain: string;
15
16
  }>;
16
17
 
17
18
  /**
18
- * Parameters of the send transaction rpc request
19
+ * SSO Metadata
19
20
  */
20
- type SiweAuthenticationParams = Omit<SiweMessage, "address" | "chainId">;
21
+ type SsoMetadata = {
22
+ logoUrl: string;
23
+ homepageLink: string;
24
+ links?: {
25
+ confidentialityLink?: string;
26
+ helpLink?: string;
27
+ cguLink?: string;
28
+ };
29
+ };
21
30
  /**
22
- * Same stuff but in an object format for better readability
31
+ * Params to start a SSO
23
32
  */
24
- type SiweAuthenticateActionParamsType = Readonly<{
25
- siwe?: Partial<SiweAuthenticationParams>;
26
- context?: string;
33
+ type OpenSsoParamsType = {
34
+ redirectUrl?: string;
35
+ directExit?: boolean;
36
+ metadata: SsoMetadata;
37
+ };
38
+
39
+ /**
40
+ * Represent a generic modal step type
41
+ */
42
+ type GenericModalStepType<TKey, TParams, TReturns> = {
43
+ key: TKey;
44
+ params: TParams extends never ? ModalStepMetadata : ModalStepMetadata & TParams;
45
+ returns: TReturns;
46
+ };
47
+ type ModalStepMetadata = {
48
+ metadata?: {
49
+ title?: string;
50
+ description?: string;
51
+ primaryActionText?: string;
52
+ secondaryActionText?: string;
53
+ };
54
+ };
55
+
56
+ type LoginWithSso = {
57
+ allowSso: true;
58
+ ssoMetadata: SsoMetadata;
59
+ };
60
+ type LoginWithoutSso = {
61
+ allowSso?: false;
62
+ ssoMetadata?: never;
63
+ };
64
+ /**
65
+ * Generic type of modal we will display to the end user
66
+ */
67
+ type LoginModalStepType = GenericModalStepType<"login", {
68
+ articleUrl?: string;
69
+ } & (LoginWithSso | LoginWithoutSso), {
70
+ wallet: Address;
27
71
  }>;
72
+
73
+ /**
74
+ * Parameters of the send transaction rpc request
75
+ */
76
+ type SiweAuthenticationParams = Omit<SiweMessage, "address" | "chainId">;
28
77
  /**
29
78
  * Return type of the send transaction rpc request
30
79
  */
@@ -32,25 +81,21 @@ type SiweAuthenticateReturnType = Readonly<{
32
81
  signature: Hex;
33
82
  message: string;
34
83
  }>;
35
-
36
84
  /**
37
- * Parameters of the send transaction rpc request
85
+ * Generic type of modal we will display to the end user
38
86
  */
39
- type SendTransactionRpcParamsType = [
40
- tx: SendTransactionTxType | SendTransactionTxType[],
41
- context?: string
42
- ];
87
+ type SiweAuthenticateModalStepType = GenericModalStepType<"siweAuthenticate", {
88
+ siwe: SiweAuthenticationParams;
89
+ }, SiweAuthenticateReturnType>;
90
+
43
91
  /**
44
- * Same stuff but in an object format for better readability
92
+ * Generic format representing a tx to be sent
93
+ * todo: exploit the EIP-5792 here? https://eips.ethereum.org/EIPS/eip-5792
45
94
  */
46
- type SendTransactionActionParamsType = Readonly<{
47
- tx: SendTransactionTxType | SendTransactionTxType[];
48
- context?: string;
49
- }>;
50
95
  type SendTransactionTxType = Readonly<{
51
96
  to: Address;
52
- data: Hex;
53
- value: Hex;
97
+ data?: Hex;
98
+ value?: Hex;
54
99
  }>;
55
100
  /**
56
101
  * Return type of the send transaction rpc request
@@ -58,114 +103,79 @@ type SendTransactionTxType = Readonly<{
58
103
  type SendTransactionReturnType = Readonly<{
59
104
  hash: Hex;
60
105
  }>;
61
-
62
- type PaidArticleUnlockPrice = Readonly<{
63
- index: number;
64
- unlockDurationInSec: number;
65
- frkAmount: Hex;
66
- }>;
106
+ type SendTransactionModalStepType = GenericModalStepType<"sendTransaction", {
107
+ tx: SendTransactionTxType | SendTransactionTxType[];
108
+ }, SendTransactionReturnType>;
67
109
 
68
110
  /**
69
- * Request to unlock a paid article
111
+ * Return type of the send transaction rpc request
70
112
  */
71
- type StartArticleUnlockParams = Readonly<{
72
- articleId: Hex;
73
- contentId: Hex;
74
- imageUrl: string;
75
- articleTitle: string;
76
- contentTitle: string;
77
- price: PaidArticleUnlockPrice;
78
- articleUrl: string;
79
- redirectUrl: string;
80
- previewUrl?: string;
81
- provider: "le-monde" | "wired" | "l-equipe";
113
+ type OpenInteractionSessionReturnType = Readonly<{
114
+ startTimestamp: number;
115
+ endTimestamp: number;
82
116
  }>;
83
117
  /**
84
- * Return type of the unlock request
118
+ * Generic type of modal we will display to the end user
85
119
  */
86
- type StartArticleUnlockReturnType = UnlockSuccess | AlreadyUnlocked | UnlockError;
87
- type UnlockSuccess = {
88
- key: "success";
89
- status: "in-progress";
90
- user: Address;
91
- userOpHash: Hex;
92
- };
93
- type AlreadyUnlocked = {
94
- key: "already-unlocked";
95
- status: "unlocked";
96
- user: Address;
97
- };
98
- type UnlockError = {
99
- key: "error" | "cancelled";
100
- status: "locked";
101
- user?: Address;
102
- reason?: string;
103
- };
120
+ type OpenInteractionSessionModalStepType = GenericModalStepType<"openSession", object, OpenInteractionSessionReturnType>;
104
121
 
105
122
  /**
106
- * The response to the get unlock options response
123
+ * Generic type of modal we will display to the end user
107
124
  */
108
- type UnlockOptionsReturnType = Readonly<{
109
- frkBalanceAsHex?: Hex;
110
- prices: {
111
- index: number;
112
- unlockDurationInSec: number;
113
- frkAmount: Hex;
114
- isUserAccessible: boolean | null;
115
- }[];
116
- }>;
125
+ type SuccessModalStepType = GenericModalStepType<"success", {
126
+ sharing?: {
127
+ popupTitle?: string;
128
+ text?: string;
129
+ link?: string;
130
+ };
131
+ }, object>;
117
132
 
118
133
  /**
119
- * The different types of response for the current unlock status
134
+ * Generic type of steps we will display in the modal to the end user
120
135
  */
121
- type ArticleUnlockStatusReturnType = Readonly<UnlockStatusLocked | UnlockStatusProcessing | UnlockStatusValid | UnlockStatusError>;
136
+ type ModalStepTypes = LoginModalStepType | SiweAuthenticateModalStepType | SendTransactionModalStepType | OpenInteractionSessionModalStepType | SuccessModalStepType;
122
137
  /**
123
- * When the content unlocked was expired or not unlocked
138
+ * Type for the result of a modal request
124
139
  */
125
- type UnlockStatusLocked = {
126
- key: "expired";
127
- status: "locked";
128
- expiredAt: number;
129
- } | {
130
- key: "not-unlocked";
131
- status: "locked";
140
+ type ModalRpcStepsResultType<T extends ModalStepTypes[] = ModalStepTypes[]> = {
141
+ [K in T[number]["key"]]: Extract<T[number], {
142
+ key: K;
143
+ }>["returns"];
132
144
  };
133
145
  /**
134
- * When the content unlock is in progress
146
+ * Type for the RPC input of a modal
135
147
  */
136
- type UnlockStatusProcessing = {
137
- status: "in-progress";
138
- } & ({
139
- key: "preparing" | "waiting-user-validation";
140
- } | {
141
- key: "waiting-transaction-bundling";
142
- userOpHash: Hex;
143
- } | {
144
- key: "waiting-transaction-confirmation";
145
- userOpHash: Hex;
146
- txHash: Hex;
147
- });
148
+ type ModalRpcStepsInput<T extends ModalStepTypes[] = ModalStepTypes[]> = {
149
+ [K in T[number]["key"]]?: Extract<T[number], {
150
+ key: K;
151
+ }>["params"];
152
+ };
148
153
  /**
149
- * When the content is unlocked
154
+ * RPC metadata for the modal
150
155
  */
151
- type UnlockStatusValid = {
152
- key: "valid";
153
- status: "unlocked";
154
- allowedUntil: number;
155
- };
156
+ type ModalRpcMetadata = Readonly<{
157
+ header?: {
158
+ title?: string;
159
+ icon?: string;
160
+ };
161
+ context?: string;
162
+ }>;
156
163
  /**
157
- * When the unlock content is in error
164
+ * Generic params used to display modals
158
165
  */
159
- type UnlockStatusError = {
160
- key: "error";
161
- status: "locked";
162
- reason: string;
166
+ type DisplayModalParamsType<T extends ModalStepTypes[]> = {
167
+ steps: ModalRpcStepsInput<T>;
168
+ metadata?: ModalRpcMetadata;
163
169
  };
164
170
 
165
171
  type WalletStatusReturnType = Readonly<WalletConnected | WalletNotConnected>;
166
172
  type WalletConnected = {
167
173
  key: "connected";
168
174
  wallet: Address;
175
+ interactionSession?: {
176
+ startTimestamp: number;
177
+ endTimestamp: number;
178
+ };
169
179
  };
170
180
  type WalletNotConnected = {
171
181
  key: "not-connected";
@@ -175,14 +185,6 @@ type WalletNotConnected = {
175
185
  * RPC interface that's used for the iframe communication
176
186
  */
177
187
  type IFrameRpcSchema = [
178
- /**
179
- * Method used to fetch an article unlock options
180
- */
181
- {
182
- Method: "frak_getArticleUnlockOptions";
183
- Parameters: [contentId: Hex, articleId: Hex];
184
- ReturnType: UnlockOptionsReturnType;
185
- },
186
188
  /**
187
189
  * Method used to listen to the wallet status
188
190
  */
@@ -192,28 +194,16 @@ type IFrameRpcSchema = [
192
194
  ReturnType: WalletStatusReturnType;
193
195
  },
194
196
  /**
195
- * Method used to listen to an article unlock status
196
- */
197
- {
198
- Method: "frak_listenToArticleUnlockStatus";
199
- Parameters: [contentId: Hex, articleId: Hex];
200
- ReturnType: ArticleUnlockStatusReturnType;
201
- },
202
- /**
203
- * Method to ask the user to send a transaction
204
- */
205
- {
206
- Method: "frak_sendTransaction";
207
- Parameters: SendTransactionRpcParamsType;
208
- ReturnType: SendTransactionReturnType;
209
- },
210
- /**
211
- * Method to ask the user for a strong authentication
197
+ * Method to transmit a user interaction
212
198
  */
213
199
  {
214
- Method: "frak_siweAuthenticate";
215
- Parameters: [request: SiweAuthenticationParams, context?: string];
216
- ReturnType: SiweAuthenticateReturnType;
200
+ Method: "frak_displayModal";
201
+ Parameters: [
202
+ requests: ModalRpcStepsInput,
203
+ name: string,
204
+ metadata?: ModalRpcMetadata
205
+ ];
206
+ ReturnType: ModalRpcStepsResultType;
217
207
  },
218
208
  /**
219
209
  * Method to transmit a user interaction
@@ -226,20 +216,18 @@ type IFrameRpcSchema = [
226
216
  signature?: Hex
227
217
  ];
228
218
  ReturnType: SendInteractionReturnType;
229
- }
230
- ];
231
- /**
232
- * RPC interface that's used for the redirection communication
233
- */
234
- type RedirectRpcSchema = [
219
+ },
235
220
  /**
236
- * Method used to start the unlock of an article
221
+ * Method to start a SSO
237
222
  */
238
223
  {
239
- Method: "frak_startArticleUnlock";
240
- Path: "/paywall";
241
- Parameters: StartArticleUnlockParams;
242
- ReturnType: StartArticleUnlockReturnType;
224
+ Method: "frak_sso";
225
+ Parameters: [
226
+ params: OpenSsoParamsType,
227
+ name: string,
228
+ customCss?: string
229
+ ];
230
+ ReturnType: undefined;
243
231
  }
244
232
  ];
245
233
 
@@ -327,6 +315,11 @@ type IFrameRpcEvent = {
327
315
  };
328
316
  type IFrameLifecycleEvent = {
329
317
  lifecycle: "connected" | "show" | "hide";
318
+ data: never;
319
+ } | LifecycleEventCSS;
320
+ type LifecycleEventCSS = {
321
+ lifecycle: "modal-css";
322
+ data: string;
330
323
  };
331
324
 
332
325
  /**
@@ -336,4 +329,4 @@ type NexusClient = {
336
329
  config: NexusWalletSdkConfig;
337
330
  } & IFrameTransport;
338
331
 
339
- export type { ArticleUnlockStatusReturnType as A, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, NexusClient as N, PaidArticleUnlockPrice as P, RedirectRpcSchema as R, StartArticleUnlockParams as S, UnlockOptionsReturnType as U, WalletStatusReturnType as W, NexusWalletSdkConfig as a, StartArticleUnlockReturnType as b, SendTransactionActionParamsType as c, SendTransactionReturnType as d, SendTransactionTxType as e, SiweAuthenticateReturnType as f, SiweAuthenticateActionParamsType as g, SiweAuthenticationParams as h, RpcResponse as i, IFrameTransport as j, IFrameRpcEvent as k, IFrameEvent as l, ExtractedReturnTypeFromRpc as m };
332
+ export type { DisplayModalParamsType as D, ExtractedParametersFromRpc as E, IFrameRpcSchema as I, LoginModalStepType as L, ModalRpcMetadata as M, NexusClient as N, OpenSsoParamsType as O, RpcResponse as R, SiweAuthenticationParams as S, WalletStatusReturnType as W, SiweAuthenticateReturnType as a, SendTransactionModalStepType as b, SendTransactionReturnType as c, ModalStepTypes as d, ModalRpcStepsResultType as e, NexusWalletSdkConfig as f, SuccessModalStepType as g, SsoMetadata as h, ModalRpcStepsInput as i, ModalStepMetadata as j, SiweAuthenticateModalStepType as k, SendTransactionTxType as l, OpenInteractionSessionReturnType as m, OpenInteractionSessionModalStepType as n, IFrameTransport as o, IFrameRpcEvent as p, IFrameEvent as q, ExtractedReturnTypeFromRpc as r };
@@ -5,10 +5,7 @@
5
5
 
6
6
 
7
7
 
8
-
9
-
10
- var _chunk3T2FNW6Ecjs = require('../../chunk-3T2FNW6E.cjs');
11
- require('../../chunk-BPFJZRJ6.cjs');
8
+ var _chunkS5FVCA2Ecjs = require('../../chunk-S5FVCA2E.cjs');
12
9
  require('../../chunk-ETV4XYOV.cjs');
13
10
 
14
11
 
@@ -17,6 +14,4 @@ require('../../chunk-ETV4XYOV.cjs');
17
14
 
18
15
 
19
16
 
20
-
21
-
22
- exports.decodeStartUnlockReturn = _chunk3T2FNW6Ecjs.decodeStartUnlockReturn; exports.getArticleUnlockOptions = _chunk3T2FNW6Ecjs.getArticleUnlockOptions; exports.getStartArticleUnlockUrl = _chunk3T2FNW6Ecjs.getStartArticleUnlockUrl; exports.sendInteraction = _chunk3T2FNW6Ecjs.sendInteraction; exports.sendTransaction = _chunk3T2FNW6Ecjs.sendTransaction; exports.siweAuthenticate = _chunk3T2FNW6Ecjs.siweAuthenticate; exports.watchUnlockStatus = _chunk3T2FNW6Ecjs.watchUnlockStatus; exports.watchWalletStatus = _chunk3T2FNW6Ecjs.watchWalletStatus;
17
+ exports.displayModal = _chunkS5FVCA2Ecjs.displayModal; exports.openSso = _chunkS5FVCA2Ecjs.openSso; exports.sendInteraction = _chunkS5FVCA2Ecjs.sendInteraction; exports.sendTransaction = _chunkS5FVCA2Ecjs.sendTransaction; exports.siweAuthenticate = _chunkS5FVCA2Ecjs.siweAuthenticate; exports.watchWalletStatus = _chunkS5FVCA2Ecjs.watchWalletStatus;
@@ -1,6 +1,6 @@
1
- export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-CxnibdQx.cjs';
2
- import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, b as StartArticleUnlockReturnType, S as StartArticleUnlockParams, c as SendTransactionActionParamsType, d as SendTransactionReturnType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType } from '../../client--U_6SK0l.cjs';
3
- import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D_CzyqRE.cjs';
1
+ import { N as NexusClient, W as WalletStatusReturnType, d as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-C7u9zGwC.cjs';
2
+ import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D3-M3nBh.cjs';
3
+ export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-BZW627cT.cjs';
4
4
  import 'viem';
5
5
  import 'viem/chains';
6
6
  import 'viem/siwe';
@@ -12,47 +12,28 @@ import 'viem/siwe';
12
12
  */
13
13
  declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
14
14
 
15
- type GetStartUnlockUrlParams = StartArticleUnlockParams;
16
15
  /**
17
- * Function used to build the unlock URL for a given article
18
- * @param config
19
- * @param params
20
- */
21
- declare function getStartArticleUnlockUrl(config: NexusWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
22
- /**
23
- * Function used to decode the response from the start unlock request (return typed passed as query param)
24
- */
25
- declare function decodeStartUnlockReturn({ result, hash, }: {
26
- result: string;
27
- hash: string;
28
- }): Promise<Readonly<StartArticleUnlockReturnType & {
29
- validationHash: string;
30
- }>>;
31
-
32
- /**
33
- * Function used to send a user transaction
16
+ * Function used to send an interaction
34
17
  * @param client
35
- * @param tx
36
- * @param context
37
- * @param callback
18
+ * @param contentId
19
+ * @param request
20
+ * @param validation
38
21
  */
39
- declare function sendTransaction(client: NexusClient, { tx, context }: SendTransactionActionParamsType): Promise<SendTransactionReturnType>;
22
+ declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
40
23
 
41
24
  /**
42
- * Function used to launch a siwe authentication
25
+ * Function used to display a modal
43
26
  * @param client
44
- * @param siwe
45
- * @param context
27
+ * @param contentId
46
28
  */
47
- declare function siweAuthenticate(client: NexusClient, { siwe, context }: SiweAuthenticateActionParamsType): Promise<SiweAuthenticateReturnType>;
29
+ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: NexusClient, { steps, metadata }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
48
30
 
49
31
  /**
50
- * Function used to send an interaction
32
+ * Function used to open the SSO
33
+ * 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
51
34
  * @param client
52
- * @param contentId
53
- * @param request
54
- * @param validation
35
+ * @param args
55
36
  */
56
- declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
37
+ declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
57
38
 
58
- export { decodeStartUnlockReturn, getStartArticleUnlockUrl, sendInteraction, sendTransaction, siweAuthenticate, watchWalletStatus };
39
+ export { displayModal, openSso, sendInteraction, watchWalletStatus };
@@ -1,6 +1,6 @@
1
- export { G as GetUnlockOptionsParams, W as WatchUnlockStatusParams, g as getArticleUnlockOptions, w as watchUnlockStatus } from '../../watchUnlockStatus-g8wIxpeM.js';
2
- import { N as NexusClient, W as WalletStatusReturnType, a as NexusWalletSdkConfig, b as StartArticleUnlockReturnType, S as StartArticleUnlockParams, c as SendTransactionActionParamsType, d as SendTransactionReturnType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType } from '../../client-6_BJp7Ub.js';
3
- import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D_CzyqRE.js';
1
+ import { N as NexusClient, W as WalletStatusReturnType, d as ModalStepTypes, D as DisplayModalParamsType, e as ModalRpcStepsResultType, O as OpenSsoParamsType } from '../../client-gE3fYzkD.js';
2
+ import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../../interaction-D3-M3nBh.js';
3
+ export { b as SendTransactionParams, S as SiweAuthenticateModalParams, a as sendTransaction, s as siweAuthenticate } from '../../sendTransaction-DpJTfGJc.js';
4
4
  import 'viem';
5
5
  import 'viem/chains';
6
6
  import 'viem/siwe';
@@ -12,47 +12,28 @@ import 'viem/siwe';
12
12
  */
13
13
  declare function watchWalletStatus(client: NexusClient, callback: (status: WalletStatusReturnType) => void): Promise<void>;
14
14
 
15
- type GetStartUnlockUrlParams = StartArticleUnlockParams;
16
15
  /**
17
- * Function used to build the unlock URL for a given article
18
- * @param config
19
- * @param params
20
- */
21
- declare function getStartArticleUnlockUrl(config: NexusWalletSdkConfig, params: GetStartUnlockUrlParams): Promise<string>;
22
- /**
23
- * Function used to decode the response from the start unlock request (return typed passed as query param)
24
- */
25
- declare function decodeStartUnlockReturn({ result, hash, }: {
26
- result: string;
27
- hash: string;
28
- }): Promise<Readonly<StartArticleUnlockReturnType & {
29
- validationHash: string;
30
- }>>;
31
-
32
- /**
33
- * Function used to send a user transaction
16
+ * Function used to send an interaction
34
17
  * @param client
35
- * @param tx
36
- * @param context
37
- * @param callback
18
+ * @param contentId
19
+ * @param request
20
+ * @param validation
38
21
  */
39
- declare function sendTransaction(client: NexusClient, { tx, context }: SendTransactionActionParamsType): Promise<SendTransactionReturnType>;
22
+ declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
40
23
 
41
24
  /**
42
- * Function used to launch a siwe authentication
25
+ * Function used to display a modal
43
26
  * @param client
44
- * @param siwe
45
- * @param context
27
+ * @param contentId
46
28
  */
47
- declare function siweAuthenticate(client: NexusClient, { siwe, context }: SiweAuthenticateActionParamsType): Promise<SiweAuthenticateReturnType>;
29
+ declare function displayModal<T extends ModalStepTypes[] = ModalStepTypes[]>(client: NexusClient, { steps, metadata }: DisplayModalParamsType<T>): Promise<ModalRpcStepsResultType<T>>;
48
30
 
49
31
  /**
50
- * Function used to send an interaction
32
+ * Function used to open the SSO
33
+ * 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
51
34
  * @param client
52
- * @param contentId
53
- * @param request
54
- * @param validation
35
+ * @param args
55
36
  */
56
- declare function sendInteraction(client: NexusClient, { contentId, interaction, validation }: SendInteractionParamsType): Promise<SendInteractionReturnType>;
37
+ declare function openSso(client: NexusClient, args: OpenSsoParamsType): Promise<void>;
57
38
 
58
- export { decodeStartUnlockReturn, getStartArticleUnlockUrl, sendInteraction, sendTransaction, siweAuthenticate, watchWalletStatus };
39
+ export { displayModal, openSso, sendInteraction, watchWalletStatus };
@@ -1,22 +1,17 @@
1
1
  import {
2
- decodeStartUnlockReturn,
3
- getArticleUnlockOptions,
4
- getStartArticleUnlockUrl,
2
+ displayModal,
3
+ openSso,
5
4
  sendInteraction,
6
5
  sendTransaction,
7
6
  siweAuthenticate,
8
- watchUnlockStatus,
9
7
  watchWalletStatus
10
- } from "../../chunk-T54VMWHQ.js";
11
- import "../../chunk-TPC5PMRC.js";
8
+ } from "../../chunk-5CFD5FM2.js";
12
9
  import "../../chunk-PKBMQBKP.js";
13
10
  export {
14
- decodeStartUnlockReturn,
15
- getArticleUnlockOptions,
16
- getStartArticleUnlockUrl,
11
+ displayModal,
12
+ openSso,
17
13
  sendInteraction,
18
14
  sendTransaction,
19
15
  siweAuthenticate,
20
- watchUnlockStatus,
21
16
  watchWalletStatus
22
17
  };
@@ -1,13 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSGLR6RFAcjs = require('../chunk-SGLR6RFA.cjs');
4
3
 
5
4
 
6
5
 
7
6
 
8
7
 
9
-
10
- var _chunkBPFJZRJ6cjs = require('../chunk-BPFJZRJ6.cjs');
8
+ var _chunkV3S6RBRJcjs = require('../chunk-V3S6RBRJ.cjs');
11
9
  require('../chunk-ETV4XYOV.cjs');
12
10
 
13
11
 
@@ -16,4 +14,4 @@ require('../chunk-ETV4XYOV.cjs');
16
14
 
17
15
 
18
16
 
19
- exports.FrakRpcError = _chunkBPFJZRJ6cjs.FrakRpcError; exports.RpcErrorCodes = _chunkBPFJZRJ6cjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunkSGLR6RFAcjs.createIFrameNexusClient; exports.createIframe = _chunkBPFJZRJ6cjs.createIframe; exports.decompressDataAndCheckHash = _chunkBPFJZRJ6cjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunkBPFJZRJ6cjs.hashAndCompressData;
17
+ exports.FrakRpcError = _chunkV3S6RBRJcjs.FrakRpcError; exports.RpcErrorCodes = _chunkV3S6RBRJcjs.RpcErrorCodes; exports.createIFrameNexusClient = _chunkV3S6RBRJcjs.createIFrameNexusClient; exports.createIframe = _chunkV3S6RBRJcjs.createIframe; exports.decompressDataAndCheckHash = _chunkV3S6RBRJcjs.decompressDataAndCheckHash; exports.hashAndCompressData = _chunkV3S6RBRJcjs.hashAndCompressData;
@@ -1,6 +1,6 @@
1
- import { a as NexusWalletSdkConfig, N as NexusClient } from '../client--U_6SK0l.cjs';
2
- export { A as ArticleUnlockStatusReturnType, E as ExtractedParametersFromRpc, m as ExtractedReturnTypeFromRpc, l as IFrameEvent, k as IFrameRpcEvent, I as IFrameRpcSchema, j as IFrameTransport, P as PaidArticleUnlockPrice, R as RedirectRpcSchema, i as RpcResponse, c as SendTransactionActionParamsType, d as SendTransactionReturnType, e as SendTransactionTxType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as StartArticleUnlockParams, b as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client--U_6SK0l.cjs';
3
- export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D_CzyqRE.cjs';
1
+ import { f as NexusWalletSdkConfig, N as NexusClient } from '../client-C7u9zGwC.cjs';
2
+ export { D as DisplayModalParamsType, E as ExtractedParametersFromRpc, r as ExtractedReturnTypeFromRpc, q as IFrameEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, M as ModalRpcMetadata, i as ModalRpcStepsInput, e as ModalRpcStepsResultType, j as ModalStepMetadata, d as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, b as SendTransactionModalStepType, c as SendTransactionReturnType, l as SendTransactionTxType, k as SiweAuthenticateModalStepType, a as SiweAuthenticateReturnType, S as SiweAuthenticationParams, h as SsoMetadata, g as SuccessModalStepType, W as WalletStatusReturnType } from '../client-C7u9zGwC.cjs';
3
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D3-M3nBh.cjs';
4
4
  export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.cjs';
5
5
  import 'viem';
6
6
  import 'viem/chains';
@@ -1,6 +1,6 @@
1
- import { a as NexusWalletSdkConfig, N as NexusClient } from '../client-6_BJp7Ub.js';
2
- export { A as ArticleUnlockStatusReturnType, E as ExtractedParametersFromRpc, m as ExtractedReturnTypeFromRpc, l as IFrameEvent, k as IFrameRpcEvent, I as IFrameRpcSchema, j as IFrameTransport, P as PaidArticleUnlockPrice, R as RedirectRpcSchema, i as RpcResponse, c as SendTransactionActionParamsType, d as SendTransactionReturnType, e as SendTransactionTxType, g as SiweAuthenticateActionParamsType, f as SiweAuthenticateReturnType, h as SiweAuthenticationParams, S as StartArticleUnlockParams, b as StartArticleUnlockReturnType, U as UnlockOptionsReturnType, W as WalletStatusReturnType } from '../client-6_BJp7Ub.js';
3
- export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D_CzyqRE.js';
1
+ import { f as NexusWalletSdkConfig, N as NexusClient } from '../client-gE3fYzkD.js';
2
+ export { D as DisplayModalParamsType, E as ExtractedParametersFromRpc, r as ExtractedReturnTypeFromRpc, q as IFrameEvent, p as IFrameRpcEvent, I as IFrameRpcSchema, o as IFrameTransport, L as LoginModalStepType, M as ModalRpcMetadata, i as ModalRpcStepsInput, e as ModalRpcStepsResultType, j as ModalStepMetadata, d as ModalStepTypes, n as OpenInteractionSessionModalStepType, m as OpenInteractionSessionReturnType, O as OpenSsoParamsType, R as RpcResponse, b as SendTransactionModalStepType, c as SendTransactionReturnType, l as SendTransactionTxType, k as SiweAuthenticateModalStepType, a as SiweAuthenticateReturnType, S as SiweAuthenticationParams, h as SsoMetadata, g as SuccessModalStepType, W as WalletStatusReturnType } from '../client-gE3fYzkD.js';
3
+ export { P as PreparedInteraction, S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-D3-M3nBh.js';
4
4
  export { F as FrakRpcError, R as RpcErrorCodes } from '../error-C4Zm5nQe.js';
5
5
  import 'viem';
6
6
  import 'viem/chains';
@@ -1,13 +1,11 @@
1
- import {
2
- createIFrameNexusClient
3
- } from "../chunk-HOX3RRO6.js";
4
1
  import {
5
2
  FrakRpcError,
6
3
  RpcErrorCodes,
4
+ createIFrameNexusClient,
7
5
  createIframe,
8
6
  decompressDataAndCheckHash,
9
7
  hashAndCompressData
10
- } from "../chunk-TPC5PMRC.js";
8
+ } from "../chunk-7MVQQ2X6.js";
11
9
  import "../chunk-PKBMQBKP.js";
12
10
  export {
13
11
  FrakRpcError,
@@ -1,9 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkNIFJZD3Mcjs = require('../../chunk-NIFJZD3M.cjs');
4
+
5
+
6
+ var _chunkIQQTTKJLcjs = require('../../chunk-IQQTTKJL.cjs');
5
7
  require('../../chunk-ETV4XYOV.cjs');
6
8
 
7
9
 
8
10
 
9
- exports.PressActionsSelector = _chunkNIFJZD3Mcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkNIFJZD3Mcjs.PressInteractionEncoder;
11
+
12
+
13
+ exports.PressActionsSelector = _chunkIQQTTKJLcjs.PressActionsSelector; exports.PressInteractionEncoder = _chunkIQQTTKJLcjs.PressInteractionEncoder; exports.ReferralActionsSelector = _chunkIQQTTKJLcjs.ReferralActionsSelector; exports.ReferralInteractionEncoder = _chunkIQQTTKJLcjs.ReferralInteractionEncoder;