@frak-labs/nexus-sdk 0.0.14 → 0.0.15
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/README.md +4 -4
- package/dist/NexusContext-CSlCNW-G.d.cts +10 -0
- package/dist/NexusContext-CSlCNW-G.d.ts +10 -0
- package/dist/bundle/bundle.js +21 -0
- package/dist/chunk-2LAGZ6S5.js +246 -0
- package/dist/chunk-4ADWI2GG.cjs +243 -0
- package/dist/chunk-4LT3U3H4.cjs +246 -0
- package/dist/{chunk-5LZQXBFJ.js → chunk-ARQTOP44.js} +12 -196
- package/dist/chunk-C25NTD45.cjs +100 -0
- package/dist/chunk-DILTMQBI.cjs +51 -0
- package/dist/{chunk-IH3QWPWT.js → chunk-I47XQDS3.js} +44 -16
- package/dist/chunk-K4FOGADW.js +51 -0
- package/dist/chunk-KEATMEOW.cjs +207 -0
- package/dist/chunk-VMNURFPI.js +207 -0
- package/dist/{client-DJd7-ajw.d.ts → client-B3Guoe3I.d.ts} +7 -4
- package/dist/{client-DXITs1Kf.d.cts → client-Of9uIxuI.d.cts} +7 -4
- package/dist/core/actions/index.cjs +11 -3
- package/dist/core/actions/index.d.cts +28 -4
- package/dist/core/actions/index.d.ts +28 -4
- package/dist/core/actions/index.js +10 -2
- package/dist/core/index.cjs +9 -4
- package/dist/core/index.d.cts +66 -4
- package/dist/core/index.d.ts +66 -4
- package/dist/core/index.js +9 -4
- package/dist/core/interactions/index.cjs +3 -6
- package/dist/core/interactions/index.d.cts +19 -15
- package/dist/core/interactions/index.d.ts +19 -15
- package/dist/core/interactions/index.js +4 -7
- package/dist/{error-C4Zm5nQe.d.cts → error-Dflr3G5x.d.cts} +1 -1
- package/dist/{error-C4Zm5nQe.d.ts → error-Dflr3G5x.d.ts} +1 -1
- package/dist/react/index.cjs +74 -150
- package/dist/react/index.d.cts +4 -5
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +72 -148
- package/dist/{sendTransaction-fLvpfqaQ.d.ts → sendTransaction-3d8jO9CJ.d.ts} +1 -1
- package/dist/{sendTransaction-C19oCc6X.d.cts → sendTransaction-Cz6FoB9_.d.cts} +1 -1
- package/package.json +5 -5
- package/dist/chunk-22T2NHQK.js +0 -22
- package/dist/chunk-5SGDBU5S.cjs +0 -427
- package/dist/chunk-AANA3LEO.cjs +0 -22
- package/dist/chunk-ETV4XYOV.cjs +0 -7
- package/dist/chunk-PKBMQBKP.js +0 -7
- package/dist/chunk-PURWUKEM.cjs +0 -72
- package/dist/chunk-S223FMEJ.js +0 -86
- package/dist/chunk-UOEVM7TR.cjs +0 -86
- package/dist/index.cjs +0 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -0
package/dist/react/index.cjs
CHANGED
|
@@ -1,5 +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
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -7,20 +8,17 @@
|
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
var _chunk5SGDBU5Scjs = require('../chunk-5SGDBU5S.cjs');
|
|
11
11
|
|
|
12
|
+
var _chunkKEATMEOWcjs = require('../chunk-KEATMEOW.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _chunkPURWUKEMcjs = require('../chunk-PURWUKEM.cjs');
|
|
22
|
-
require('../chunk-AANA3LEO.cjs');
|
|
23
|
-
require('../chunk-ETV4XYOV.cjs');
|
|
19
|
+
var _chunk4LT3U3H4cjs = require('../chunk-4LT3U3H4.cjs');
|
|
20
|
+
require('../chunk-C25NTD45.cjs');
|
|
21
|
+
require('../chunk-DILTMQBI.cjs');
|
|
24
22
|
|
|
25
23
|
// src/react/provider/NexusConfigProvider.ts
|
|
26
24
|
var _react = require('react');
|
|
@@ -52,8 +50,8 @@ function NexusConfigProvider(parameters) {
|
|
|
52
50
|
function useNexusConfig() {
|
|
53
51
|
const config = _react.useContext.call(void 0, NexusConfigContext);
|
|
54
52
|
if (!config) {
|
|
55
|
-
throw new (0,
|
|
56
|
-
|
|
53
|
+
throw new (0, _chunk4LT3U3H4cjs.FrakRpcError)(
|
|
54
|
+
_chunk4LT3U3H4cjs.RpcErrorCodes.configError,
|
|
57
55
|
"Nexus config not found"
|
|
58
56
|
);
|
|
59
57
|
}
|
|
@@ -86,18 +84,9 @@ function useWalletStatus() {
|
|
|
86
84
|
queryKey: ["nexus-sdk", "wallet-status-listener"],
|
|
87
85
|
queryFn: async () => {
|
|
88
86
|
if (!client) {
|
|
89
|
-
throw new (0,
|
|
87
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
let hasResolved = false;
|
|
93
|
-
await _chunkUOEVM7TRcjs.watchWalletStatus.call(void 0, client, (status) => {
|
|
94
|
-
newStatusUpdated(status);
|
|
95
|
-
if (!hasResolved) {
|
|
96
|
-
firstResult.resolve(status);
|
|
97
|
-
hasResolved = true;
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
return firstResult.promise;
|
|
89
|
+
return _chunkKEATMEOWcjs.walletStatus.call(void 0, client, newStatusUpdated);
|
|
101
90
|
},
|
|
102
91
|
enabled: !!client
|
|
103
92
|
});
|
|
@@ -114,9 +103,9 @@ function useSendTransactionAction({
|
|
|
114
103
|
mutationKey: ["nexus-sdk", "send-transaction"],
|
|
115
104
|
mutationFn: async (params) => {
|
|
116
105
|
if (!client) {
|
|
117
|
-
throw new (0,
|
|
106
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
118
107
|
}
|
|
119
|
-
return
|
|
108
|
+
return _chunkKEATMEOWcjs.sendTransaction.call(void 0, client, params);
|
|
120
109
|
}
|
|
121
110
|
});
|
|
122
111
|
}
|
|
@@ -136,9 +125,9 @@ function useSiweAuthenticate({
|
|
|
136
125
|
],
|
|
137
126
|
mutationFn: async (params) => {
|
|
138
127
|
if (!client) {
|
|
139
|
-
throw new (0,
|
|
128
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
140
129
|
}
|
|
141
|
-
return
|
|
130
|
+
return _chunkKEATMEOWcjs.siweAuthenticate.call(void 0, client, params);
|
|
142
131
|
}
|
|
143
132
|
});
|
|
144
133
|
}
|
|
@@ -146,43 +135,6 @@ function useSiweAuthenticate({
|
|
|
146
135
|
// src/react/hook/helper/useReferralInteraction.ts
|
|
147
136
|
|
|
148
137
|
|
|
149
|
-
var _viem = require('viem');
|
|
150
|
-
|
|
151
|
-
// src/react/hook/useDisplayModal.ts
|
|
152
|
-
|
|
153
|
-
function useDisplayModal({
|
|
154
|
-
mutations
|
|
155
|
-
} = {}) {
|
|
156
|
-
const client = useNexusClient();
|
|
157
|
-
return _reactquery.useMutation.call(void 0, {
|
|
158
|
-
...mutations,
|
|
159
|
-
mutationKey: ["nexus-sdk", "display-modal"],
|
|
160
|
-
mutationFn: async (args) => {
|
|
161
|
-
if (!client) {
|
|
162
|
-
throw new (0, _chunk5SGDBU5Scjs.ClientNotFound)();
|
|
163
|
-
}
|
|
164
|
-
return _chunkUOEVM7TRcjs.displayModal.call(void 0, client, args);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// src/react/hook/useSendInteraction.ts
|
|
170
|
-
|
|
171
|
-
function useSendInteraction({
|
|
172
|
-
mutations
|
|
173
|
-
} = {}) {
|
|
174
|
-
const client = useNexusClient();
|
|
175
|
-
return _reactquery.useMutation.call(void 0, {
|
|
176
|
-
...mutations,
|
|
177
|
-
mutationKey: ["nexus-sdk", "send-interaction"],
|
|
178
|
-
mutationFn: async (params) => {
|
|
179
|
-
if (!client) {
|
|
180
|
-
throw new (0, _chunk5SGDBU5Scjs.ClientNotFound)();
|
|
181
|
-
}
|
|
182
|
-
return _chunkUOEVM7TRcjs.sendInteraction.call(void 0, client, params);
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
138
|
|
|
187
139
|
// src/react/hook/utils/useNexusContext.ts
|
|
188
140
|
|
|
@@ -224,32 +176,24 @@ function useWindowLocation() {
|
|
|
224
176
|
}
|
|
225
177
|
|
|
226
178
|
// src/react/hook/utils/useNexusContext.ts
|
|
227
|
-
var contextKey = "nCtx";
|
|
228
179
|
function useNexusContext() {
|
|
229
180
|
const { location } = useWindowLocation();
|
|
230
181
|
const { data: nexusContext } = _reactquery.useQuery.call(void 0, {
|
|
231
182
|
queryKey: ["nexus-sdk", "context", _nullishCoalesce(_optionalChain([location, 'optionalAccess', _7 => _7.href]), () => ( "no-href"))],
|
|
232
183
|
queryFn: async () => {
|
|
233
184
|
if (!_optionalChain([location, 'optionalAccess', _8 => _8.href])) return null;
|
|
234
|
-
|
|
235
|
-
const nexusContext2 = url.searchParams.get(contextKey);
|
|
236
|
-
if (!nexusContext2) return null;
|
|
237
|
-
const parsedContext = await _chunk5SGDBU5Scjs.decompressJson.call(void 0, nexusContext2);
|
|
238
|
-
if (!parsedContext) return null;
|
|
239
|
-
return parsedContext;
|
|
185
|
+
return _chunk4LT3U3H4cjs.NexusContextManager.parse({ url: location.href });
|
|
240
186
|
},
|
|
241
187
|
enabled: !!_optionalChain([location, 'optionalAccess', _9 => _9.href])
|
|
242
188
|
});
|
|
243
189
|
const { mutate: updateContext, mutateAsync: updateContextAsync } = _reactquery.useMutation.call(void 0, {
|
|
244
190
|
mutationKey: ["nexus-sdk", "update-context"],
|
|
245
191
|
mutationFn: async (newContext) => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
url.searchParams.set(contextKey, compressedContext);
|
|
252
|
-
window.history.replaceState(null, "", url.toString());
|
|
192
|
+
console.log("Updating context", { newContext });
|
|
193
|
+
await _chunk4LT3U3H4cjs.NexusContextManager.replaceUrl({
|
|
194
|
+
url: _optionalChain([location, 'optionalAccess', _10 => _10.href]),
|
|
195
|
+
context: newContext
|
|
196
|
+
});
|
|
253
197
|
}
|
|
254
198
|
});
|
|
255
199
|
return {
|
|
@@ -264,47 +208,9 @@ function useReferralInteraction({
|
|
|
264
208
|
productId,
|
|
265
209
|
modalConfig
|
|
266
210
|
} = {}) {
|
|
267
|
-
const
|
|
268
|
-
const {
|
|
269
|
-
const {
|
|
270
|
-
const ensureWalletConnected = useEnsureWalletConnected({
|
|
271
|
-
modalConfig,
|
|
272
|
-
walletStatus
|
|
273
|
-
});
|
|
274
|
-
const processReferral = _react.useCallback.call(void 0, async () => {
|
|
275
|
-
try {
|
|
276
|
-
let currentWallet = _optionalChain([walletStatus, 'optionalAccess', _10 => _10.key]) === "connected" ? walletStatus.wallet : void 0;
|
|
277
|
-
if (!_optionalChain([nexusContext, 'optionalAccess', _11 => _11.r])) {
|
|
278
|
-
if (currentWallet) {
|
|
279
|
-
await updateContextAsync({ r: currentWallet });
|
|
280
|
-
}
|
|
281
|
-
return "no-referrer";
|
|
282
|
-
}
|
|
283
|
-
if (!currentWallet) {
|
|
284
|
-
currentWallet = await ensureWalletConnected();
|
|
285
|
-
}
|
|
286
|
-
if (currentWallet && _viem.isAddressEqual.call(void 0, nexusContext.r, currentWallet)) {
|
|
287
|
-
return "self-referral";
|
|
288
|
-
}
|
|
289
|
-
const interaction = _chunkPURWUKEMcjs.ReferralInteractionEncoder.referred({
|
|
290
|
-
referrer: nexusContext.r
|
|
291
|
-
});
|
|
292
|
-
await sendInteraction2({ productId, interaction });
|
|
293
|
-
if (currentWallet) {
|
|
294
|
-
await updateContextAsync({ r: currentWallet });
|
|
295
|
-
}
|
|
296
|
-
return "success";
|
|
297
|
-
} catch (error2) {
|
|
298
|
-
return mapErrorToState(error2);
|
|
299
|
-
}
|
|
300
|
-
}, [
|
|
301
|
-
nexusContext,
|
|
302
|
-
productId,
|
|
303
|
-
ensureWalletConnected,
|
|
304
|
-
sendInteraction2,
|
|
305
|
-
updateContextAsync,
|
|
306
|
-
walletStatus
|
|
307
|
-
]);
|
|
211
|
+
const client = useNexusClient();
|
|
212
|
+
const { nexusContext } = useNexusContext();
|
|
213
|
+
const { data: walletStatus2 } = useWalletStatus();
|
|
308
214
|
const {
|
|
309
215
|
data: referralState,
|
|
310
216
|
error,
|
|
@@ -315,46 +221,64 @@ function useReferralInteraction({
|
|
|
315
221
|
queryKey: [
|
|
316
222
|
"nexus-sdk",
|
|
317
223
|
"auto-referral-interaction",
|
|
318
|
-
_nullishCoalesce(_optionalChain([nexusContext, 'optionalAccess',
|
|
319
|
-
_nullishCoalesce(_optionalChain([
|
|
224
|
+
_nullishCoalesce(_optionalChain([nexusContext, 'optionalAccess', _11 => _11.r]), () => ( "no-referrer")),
|
|
225
|
+
_nullishCoalesce(_optionalChain([walletStatus2, 'optionalAccess', _12 => _12.key]), () => ( "no-wallet-status")),
|
|
226
|
+
_nullishCoalesce(productId, () => ( "no-product-id"))
|
|
320
227
|
],
|
|
321
|
-
queryFn:
|
|
322
|
-
|
|
228
|
+
queryFn: () => {
|
|
229
|
+
if (!client) {
|
|
230
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
231
|
+
}
|
|
232
|
+
return _chunkKEATMEOWcjs.processReferral.call(void 0, client, {
|
|
233
|
+
walletStatus: walletStatus2,
|
|
234
|
+
nexusContext,
|
|
235
|
+
modalConfig,
|
|
236
|
+
productId
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
enabled: !!walletStatus2
|
|
323
240
|
});
|
|
324
241
|
return _react.useMemo.call(void 0, () => {
|
|
325
242
|
if (status === "pending") return "processing";
|
|
326
|
-
if (status === "error") return
|
|
243
|
+
if (status === "error") return error;
|
|
327
244
|
return referralState || "idle";
|
|
328
245
|
}, [referralState, status, error]);
|
|
329
246
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
247
|
+
|
|
248
|
+
// src/react/hook/useSendInteraction.ts
|
|
249
|
+
|
|
250
|
+
function useSendInteraction({
|
|
251
|
+
mutations
|
|
252
|
+
} = {}) {
|
|
253
|
+
const client = useNexusClient();
|
|
254
|
+
return _reactquery.useMutation.call(void 0, {
|
|
255
|
+
...mutations,
|
|
256
|
+
mutationKey: ["nexus-sdk", "send-interaction"],
|
|
257
|
+
mutationFn: async (params) => {
|
|
258
|
+
if (!client) {
|
|
259
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
339
260
|
}
|
|
340
|
-
|
|
341
|
-
return _nullishCoalesce(_optionalChain([result, 'optionalAccess', _15 => _15.login, 'optionalAccess', _16 => _16.wallet]), () => ( void 0));
|
|
261
|
+
return _chunkKEATMEOWcjs.sendInteraction.call(void 0, client, params);
|
|
342
262
|
}
|
|
343
|
-
|
|
344
|
-
}, [walletStatus, modalConfig, displayModal2]);
|
|
263
|
+
});
|
|
345
264
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
265
|
+
|
|
266
|
+
// src/react/hook/useDisplayModal.ts
|
|
267
|
+
|
|
268
|
+
function useDisplayModal({
|
|
269
|
+
mutations
|
|
270
|
+
} = {}) {
|
|
271
|
+
const client = useNexusClient();
|
|
272
|
+
return _reactquery.useMutation.call(void 0, {
|
|
273
|
+
...mutations,
|
|
274
|
+
mutationKey: ["nexus-sdk", "display-modal"],
|
|
275
|
+
mutationFn: async (args) => {
|
|
276
|
+
if (!client) {
|
|
277
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
278
|
+
}
|
|
279
|
+
return _chunkKEATMEOWcjs.displayModal.call(void 0, client, args);
|
|
355
280
|
}
|
|
356
|
-
}
|
|
357
|
-
return "error";
|
|
281
|
+
});
|
|
358
282
|
}
|
|
359
283
|
|
|
360
284
|
// src/react/hook/useOpenSso.ts
|
|
@@ -366,9 +290,9 @@ function useOpenSso({ mutations } = {}) {
|
|
|
366
290
|
mutationKey: ["nexus-sdk", "open-sso"],
|
|
367
291
|
mutationFn: async (params) => {
|
|
368
292
|
if (!client) {
|
|
369
|
-
throw new (0,
|
|
293
|
+
throw new (0, _chunk4LT3U3H4cjs.ClientNotFound)();
|
|
370
294
|
}
|
|
371
|
-
return
|
|
295
|
+
return _chunkKEATMEOWcjs.openSso.call(void 0, client, params);
|
|
372
296
|
}
|
|
373
297
|
});
|
|
374
298
|
}
|
|
@@ -384,15 +308,15 @@ function NexusIFrameClientProvider({
|
|
|
384
308
|
const config = useNexusConfig();
|
|
385
309
|
const [client, setClient] = _react.useState.call(void 0, void 0);
|
|
386
310
|
const iFrame = _react.createElement.call(void 0, "iframe", {
|
|
387
|
-
...
|
|
311
|
+
..._chunk4LT3U3H4cjs.baseIframeProps,
|
|
388
312
|
src: `${config.walletUrl}/listener`,
|
|
389
|
-
style: _nullishCoalesce(style, () => (
|
|
313
|
+
style: _nullishCoalesce(style, () => ( _chunk4LT3U3H4cjs.baseIframeProps.style)),
|
|
390
314
|
ref: (iframe) => {
|
|
391
315
|
if (!iframe || client) {
|
|
392
316
|
return;
|
|
393
317
|
}
|
|
394
318
|
setClient(
|
|
395
|
-
|
|
319
|
+
_chunk4ADWI2GGcjs.createIFrameNexusClient.call(void 0, {
|
|
396
320
|
iframe,
|
|
397
321
|
config
|
|
398
322
|
})
|
package/dist/react/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import {
|
|
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';
|
|
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
|
-
import { F as FrakRpcError } from '../error-
|
|
9
|
-
import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-
|
|
8
|
+
import { F as FrakRpcError } from '../error-Dflr3G5x.cjs';
|
|
9
|
+
import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-Cz6FoB9_.cjs';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.cjs';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -112,7 +112,6 @@ declare function useSiweAuthenticate({ mutations, }?: UseSiweAuthenticateParams)
|
|
|
112
112
|
message: string;
|
|
113
113
|
}>, FrakRpcError<undefined>, SiweAuthenticateModalParams, unknown>;
|
|
114
114
|
|
|
115
|
-
type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-session" | "error" | "no-referrer" | "self-referral";
|
|
116
115
|
/**
|
|
117
116
|
* Helper hook to automatically submit a referral interaction when detected
|
|
118
117
|
* -> And automatically set the referral context in the url
|
|
@@ -122,7 +121,7 @@ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-sessi
|
|
|
122
121
|
declare function useReferralInteraction({ productId, modalConfig, }?: {
|
|
123
122
|
productId?: Hex;
|
|
124
123
|
modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
|
|
125
|
-
}):
|
|
124
|
+
}): Error | ("success" | "error" | "idle" | "processing" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
|
|
126
125
|
|
|
127
126
|
type MutationOptions$2 = Omit<UseMutationOptions<SendInteractionReturnType, FrakRpcError, SendInteractionParamsType>, "mutationFn" | "mutationKey">;
|
|
128
127
|
interface UseSendInteractionParams$1 {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
3
|
-
import {
|
|
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';
|
|
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
|
-
import { F as FrakRpcError } from '../error-
|
|
9
|
-
import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-
|
|
8
|
+
import { F as FrakRpcError } from '../error-Dflr3G5x.js';
|
|
9
|
+
import { b as SendTransactionParams, S as SiweAuthenticateModalParams } from '../sendTransaction-3d8jO9CJ.js';
|
|
10
10
|
import { S as SendInteractionParamsType, a as SendInteractionReturnType } from '../interaction-BngPoHA0.js';
|
|
11
11
|
import 'viem/chains';
|
|
12
12
|
import 'viem/siwe';
|
|
@@ -112,7 +112,6 @@ declare function useSiweAuthenticate({ mutations, }?: UseSiweAuthenticateParams)
|
|
|
112
112
|
message: string;
|
|
113
113
|
}>, FrakRpcError<undefined>, SiweAuthenticateModalParams, unknown>;
|
|
114
114
|
|
|
115
|
-
type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-session" | "error" | "no-referrer" | "self-referral";
|
|
116
115
|
/**
|
|
117
116
|
* Helper hook to automatically submit a referral interaction when detected
|
|
118
117
|
* -> And automatically set the referral context in the url
|
|
@@ -122,7 +121,7 @@ type ReferralState = "idle" | "processing" | "success" | "no-wallet" | "no-sessi
|
|
|
122
121
|
declare function useReferralInteraction({ productId, modalConfig, }?: {
|
|
123
122
|
productId?: Hex;
|
|
124
123
|
modalConfig?: DisplayModalParamsType<ModalStepTypes[]>;
|
|
125
|
-
}):
|
|
124
|
+
}): Error | ("success" | "error" | "idle" | "processing" | "no-wallet" | "no-session" | "no-referrer" | "self-referral");
|
|
126
125
|
|
|
127
126
|
type MutationOptions$2 = Omit<UseMutationOptions<SendInteractionReturnType, FrakRpcError, SendInteractionParamsType>, "mutationFn" | "mutationKey">;
|
|
128
127
|
interface UseSendInteractionParams$1 {
|