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