@naculus/connect-appkit-vue 0.6.0 → 0.8.0
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 +10 -0
- package/dist/index.cjs +738 -505
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -5
- package/dist/index.d.ts +40 -5
- package/dist/index.js +485 -244
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -60,6 +60,7 @@ __export(index_exports, {
|
|
|
60
60
|
AppkitTooltip: () => AppkitTooltip,
|
|
61
61
|
useAccount: () => useAccount,
|
|
62
62
|
useAccounts: () => useAccounts,
|
|
63
|
+
useAuthorizations: () => useAuthorizations,
|
|
63
64
|
useBalance: () => useBalance,
|
|
64
65
|
useCapabilities: () => useCapabilities,
|
|
65
66
|
useChain: () => useChain,
|
|
@@ -78,6 +79,7 @@ __export(index_exports, {
|
|
|
78
79
|
useExecuteRoute: () => useExecuteRoute,
|
|
79
80
|
useLastTx: () => useLastTx,
|
|
80
81
|
useLookupAddress: () => useLookupAddress,
|
|
82
|
+
useMppSession: () => useMppSession,
|
|
81
83
|
useNotification: () => useNotification,
|
|
82
84
|
usePassphraseGate: () => usePassphraseGate,
|
|
83
85
|
usePaymentFetch: () => usePaymentFetch,
|
|
@@ -326,38 +328,99 @@ function useAccounts(accounts) {
|
|
|
326
328
|
};
|
|
327
329
|
}
|
|
328
330
|
|
|
329
|
-
// src/
|
|
330
|
-
var import_connect_appkit_core = require("@naculus/connect-appkit-core");
|
|
331
|
+
// src/useAuthorizations.ts
|
|
331
332
|
var import_connect_core2 = require("@naculus/connect-core");
|
|
332
333
|
var import_vue2 = require("vue");
|
|
334
|
+
function useAuthorizations({
|
|
335
|
+
managers
|
|
336
|
+
}) {
|
|
337
|
+
const entries = (0, import_vue2.shallowRef)([]);
|
|
338
|
+
const loading = (0, import_vue2.shallowRef)(false);
|
|
339
|
+
const error = (0, import_vue2.shallowRef)(null);
|
|
340
|
+
let generation = 0;
|
|
341
|
+
let disposed = false;
|
|
342
|
+
const refresh = async () => {
|
|
343
|
+
const own = ++generation;
|
|
344
|
+
loading.value = true;
|
|
345
|
+
error.value = null;
|
|
346
|
+
try {
|
|
347
|
+
const next = await (0, import_connect_core2.listAuthorizations)((0, import_vue2.unref)(managers));
|
|
348
|
+
if (!disposed && own === generation) entries.value = next;
|
|
349
|
+
} catch (cause) {
|
|
350
|
+
if (!disposed && own === generation) {
|
|
351
|
+
error.value = cause instanceof Error ? cause : new Error("Failed to list authorizations");
|
|
352
|
+
}
|
|
353
|
+
} finally {
|
|
354
|
+
if (!disposed && own === generation) loading.value = false;
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
const stop = (0, import_vue2.watch)(() => (0, import_vue2.unref)(managers), refresh, { immediate: true });
|
|
358
|
+
(0, import_vue2.onScopeDispose)(() => {
|
|
359
|
+
disposed = true;
|
|
360
|
+
generation += 1;
|
|
361
|
+
stop();
|
|
362
|
+
});
|
|
363
|
+
const revoke = async (entry) => {
|
|
364
|
+
try {
|
|
365
|
+
const result = await (0, import_connect_core2.revokeListedAuthorization)((0, import_vue2.unref)(managers), entry);
|
|
366
|
+
await refresh();
|
|
367
|
+
return result;
|
|
368
|
+
} catch (cause) {
|
|
369
|
+
const normalized = cause instanceof Error ? cause : new Error("Failed to revoke authorization");
|
|
370
|
+
if (!disposed) error.value = normalized;
|
|
371
|
+
throw normalized;
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
return { entries, loading, error, refresh, revoke };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/useNotification.ts
|
|
378
|
+
var import_connect_appkit_core = require("@naculus/connect-appkit-core");
|
|
379
|
+
var import_connect_core3 = require("@naculus/connect-core");
|
|
380
|
+
var import_vue3 = require("vue");
|
|
333
381
|
function useNotification(options = {}) {
|
|
334
|
-
const channel = (0,
|
|
335
|
-
const storage = (0,
|
|
336
|
-
const notifications = (0,
|
|
337
|
-
const settings = (0,
|
|
382
|
+
const channel = (0, import_vue3.unref)(options.channel) ?? new import_connect_core3.InAppChannel();
|
|
383
|
+
const storage = (0, import_vue3.unref)(options.storage) ?? (0, import_connect_appkit_core.createNotificationSettingsStorage)();
|
|
384
|
+
const notifications = (0, import_vue3.shallowRef)(channel.getHistory());
|
|
385
|
+
const settings = (0, import_vue3.shallowRef)(
|
|
338
386
|
import_connect_appkit_core.DEFAULT_NOTIFICATION_SETTINGS
|
|
339
387
|
);
|
|
340
|
-
const unreadCount = (0,
|
|
388
|
+
const unreadCount = (0, import_vue3.computed)(
|
|
341
389
|
() => notifications.value.filter((item) => !item.read).length
|
|
342
390
|
);
|
|
343
391
|
let disposed = false;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
392
|
+
let pending = [];
|
|
393
|
+
const settle = (saved) => {
|
|
394
|
+
const queued = pending ?? [];
|
|
395
|
+
pending = null;
|
|
396
|
+
if (disposed) return;
|
|
397
|
+
if (queued.length === 0) {
|
|
398
|
+
if (saved) settings.value = saved;
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
settings.value = (0, import_connect_appkit_core.replayNotificationSettings)(saved, queued);
|
|
402
|
+
(0, import_connect_appkit_core.saveNotificationSettings)(storage, settings.value);
|
|
403
|
+
};
|
|
404
|
+
void (0, import_connect_appkit_core.loadNotificationSettings)(storage).then(settle, () => settle(null));
|
|
347
405
|
channel.onNotification = (item) => {
|
|
348
406
|
if (!disposed) notifications.value = [...notifications.value, item];
|
|
349
407
|
};
|
|
350
408
|
void channel.restore().then(() => {
|
|
351
409
|
if (!disposed) notifications.value = channel.getHistory();
|
|
352
410
|
});
|
|
353
|
-
(0,
|
|
411
|
+
(0, import_vue3.onScopeDispose)(() => {
|
|
354
412
|
disposed = true;
|
|
355
413
|
channel.onNotification = void 0;
|
|
356
414
|
});
|
|
357
|
-
const
|
|
358
|
-
|
|
415
|
+
const applySettings = (compute) => {
|
|
416
|
+
pending?.push(compute);
|
|
417
|
+
settings.value = (0, import_connect_appkit_core.updateNotificationSettings)(
|
|
418
|
+
settings.value,
|
|
419
|
+
compute(settings.value)
|
|
420
|
+
);
|
|
359
421
|
(0, import_connect_appkit_core.saveNotificationSettings)(storage, settings.value);
|
|
360
422
|
};
|
|
423
|
+
const updateSettings = (update) => applySettings(() => update);
|
|
361
424
|
return {
|
|
362
425
|
notifications,
|
|
363
426
|
unreadCount,
|
|
@@ -387,21 +450,21 @@ function useNotification(options = {}) {
|
|
|
387
450
|
},
|
|
388
451
|
updateSettings,
|
|
389
452
|
setChannels: (channels) => updateSettings((0, import_connect_appkit_core.channelsUpdate)(channels)),
|
|
390
|
-
muteChain: (chainId) =>
|
|
391
|
-
unmuteChain: (chainId) =>
|
|
453
|
+
muteChain: (chainId) => applySettings((current) => (0, import_connect_appkit_core.mutedChainSettings)(current, chainId, true)),
|
|
454
|
+
unmuteChain: (chainId) => applySettings((current) => (0, import_connect_appkit_core.mutedChainSettings)(current, chainId, false))
|
|
392
455
|
};
|
|
393
456
|
}
|
|
394
457
|
|
|
395
458
|
// src/useSimulateTransfer.ts
|
|
396
459
|
var import_connect_appkit_core2 = require("@naculus/connect-appkit-core");
|
|
397
|
-
var
|
|
398
|
-
var
|
|
460
|
+
var import_connect_core4 = require("@naculus/connect-core");
|
|
461
|
+
var import_vue5 = require("vue");
|
|
399
462
|
|
|
400
463
|
// src/internal/action-guard.ts
|
|
401
|
-
var
|
|
464
|
+
var import_vue4 = require("vue");
|
|
402
465
|
function useActionGuard() {
|
|
403
|
-
const busy = (0,
|
|
404
|
-
const error = (0,
|
|
466
|
+
const busy = (0, import_vue4.shallowRef)(false);
|
|
467
|
+
const error = (0, import_vue4.shallowRef)(null);
|
|
405
468
|
let active = 0;
|
|
406
469
|
let generation = 0;
|
|
407
470
|
let disposed = false;
|
|
@@ -442,28 +505,28 @@ function useActionGuard() {
|
|
|
442
505
|
disposed = true;
|
|
443
506
|
generation++;
|
|
444
507
|
};
|
|
445
|
-
(0,
|
|
508
|
+
(0, import_vue4.onScopeDispose)(dispose);
|
|
446
509
|
return { busy, error, run, clearError, reset, invalidate, dispose };
|
|
447
510
|
}
|
|
448
511
|
|
|
449
512
|
// src/useSimulateTransfer.ts
|
|
450
513
|
function useSimulateTransfer(options = {}) {
|
|
451
514
|
const guard = useActionGuard();
|
|
452
|
-
const result = (0,
|
|
453
|
-
const loading = (0,
|
|
515
|
+
const result = (0, import_vue5.shallowRef)(null);
|
|
516
|
+
const loading = (0, import_vue5.shallowRef)(false);
|
|
454
517
|
let manager;
|
|
455
518
|
const simulate = async (tokenAddress, from, to, amount, callOptions) => {
|
|
456
519
|
loading.value = true;
|
|
457
520
|
return await guard.run(
|
|
458
521
|
async (commit) => {
|
|
459
|
-
const fallbackRpcUrl = (0,
|
|
522
|
+
const fallbackRpcUrl = (0, import_vue5.unref)(options.rpcUrl);
|
|
460
523
|
const endpoint = (0, import_connect_appkit_core2.resolveSimulationEndpoint)(
|
|
461
524
|
callOptions?.chainId,
|
|
462
|
-
(0,
|
|
525
|
+
(0, import_vue5.unref)(options.chainId),
|
|
463
526
|
callOptions?.rpcUrl,
|
|
464
527
|
fallbackRpcUrl
|
|
465
528
|
);
|
|
466
|
-
manager ??= new
|
|
529
|
+
manager ??= new import_connect_core4.SimulationManager({
|
|
467
530
|
enabled: true,
|
|
468
531
|
rpcUrl: fallbackRpcUrl,
|
|
469
532
|
autoSimulate: false
|
|
@@ -501,22 +564,22 @@ function useSimulateTransfer(options = {}) {
|
|
|
501
564
|
|
|
502
565
|
// src/useTransactionSimulation.ts
|
|
503
566
|
var import_connect_appkit_core3 = require("@naculus/connect-appkit-core");
|
|
504
|
-
var
|
|
567
|
+
var import_vue6 = require("vue");
|
|
505
568
|
function useTransactionSimulation(tx, options = {}) {
|
|
506
569
|
const guard = useActionGuard();
|
|
507
|
-
const result = (0,
|
|
508
|
-
const isSimulating = (0,
|
|
570
|
+
const result = (0, import_vue6.shallowRef)(void 0);
|
|
571
|
+
const isSimulating = (0, import_vue6.shallowRef)(false);
|
|
509
572
|
let timer;
|
|
510
573
|
const simulate = async () => {
|
|
511
|
-
const transaction = (0,
|
|
574
|
+
const transaction = (0, import_vue6.toValue)(tx);
|
|
512
575
|
if (transaction) isSimulating.value = true;
|
|
513
576
|
return await guard.run(
|
|
514
577
|
async (commit) => {
|
|
515
578
|
const value = await (0, import_connect_appkit_core3.simulateTransactionPreview)(transaction, {
|
|
516
|
-
chainId: (0,
|
|
517
|
-
currentChain: (0,
|
|
518
|
-
publicClient: (0,
|
|
519
|
-
evmAccount: (0,
|
|
579
|
+
chainId: (0, import_vue6.unref)(options.chainId),
|
|
580
|
+
currentChain: (0, import_vue6.unref)(options.currentChain),
|
|
581
|
+
publicClient: (0, import_vue6.unref)(options.publicClient),
|
|
582
|
+
evmAccount: (0, import_vue6.unref)(options.evmAccount)
|
|
520
583
|
});
|
|
521
584
|
commit(() => {
|
|
522
585
|
result.value = value;
|
|
@@ -533,13 +596,13 @@ function useTransactionSimulation(tx, options = {}) {
|
|
|
533
596
|
}
|
|
534
597
|
);
|
|
535
598
|
};
|
|
536
|
-
(0,
|
|
599
|
+
(0, import_vue6.watch)(
|
|
537
600
|
[
|
|
538
|
-
() => (0,
|
|
539
|
-
() => (0,
|
|
540
|
-
() => (0,
|
|
541
|
-
() => (0,
|
|
542
|
-
() => (0,
|
|
601
|
+
() => (0, import_vue6.toValue)(tx),
|
|
602
|
+
() => (0, import_vue6.unref)(options.chainId),
|
|
603
|
+
() => (0, import_vue6.unref)(options.currentChain),
|
|
604
|
+
() => (0, import_vue6.unref)(options.publicClient),
|
|
605
|
+
() => (0, import_vue6.unref)(options.evmAccount)
|
|
543
606
|
],
|
|
544
607
|
([transaction]) => {
|
|
545
608
|
guard.invalidate();
|
|
@@ -561,7 +624,7 @@ function useTransactionSimulation(tx, options = {}) {
|
|
|
561
624
|
result.value = void 0;
|
|
562
625
|
isSimulating.value = false;
|
|
563
626
|
};
|
|
564
|
-
(0,
|
|
627
|
+
(0, import_vue6.onScopeDispose)(() => {
|
|
565
628
|
if (timer) clearTimeout(timer);
|
|
566
629
|
});
|
|
567
630
|
return { result, isSimulating, error: guard.error, simulate, reset };
|
|
@@ -569,43 +632,43 @@ function useTransactionSimulation(tx, options = {}) {
|
|
|
569
632
|
|
|
570
633
|
// src/useERC20Transfer.ts
|
|
571
634
|
var import_connect_appkit_core5 = require("@naculus/connect-appkit-core");
|
|
572
|
-
var
|
|
573
|
-
var
|
|
635
|
+
var import_connect_core6 = require("@naculus/connect-core");
|
|
636
|
+
var import_vue7 = require("vue");
|
|
574
637
|
|
|
575
638
|
// src/erc20.ts
|
|
576
639
|
var import_connect_appkit_core4 = require("@naculus/connect-appkit-core");
|
|
577
|
-
var
|
|
640
|
+
var import_connect_core5 = require("@naculus/connect-core");
|
|
578
641
|
function assertErc20Context(token, chainId, account, connected) {
|
|
579
642
|
if (!connected || !account) {
|
|
580
|
-
throw new
|
|
643
|
+
throw new import_connect_core5.WalletError("wallet_unavailable", "No connected account");
|
|
581
644
|
}
|
|
582
645
|
const mismatch = (0, import_connect_appkit_core4.tokenChainMismatch)(token, chainId);
|
|
583
646
|
if (mismatch) throw mismatch;
|
|
584
647
|
const bare = (0, import_connect_appkit_core4.bareEvmAddress)(account);
|
|
585
648
|
if (!bare) {
|
|
586
|
-
throw new
|
|
649
|
+
throw new import_connect_core5.WalletError("wallet_unavailable", "No valid EVM account");
|
|
587
650
|
}
|
|
588
651
|
return bare;
|
|
589
652
|
}
|
|
590
653
|
|
|
591
654
|
// src/useERC20Transfer.ts
|
|
592
655
|
function useERC20Transfer(options) {
|
|
593
|
-
const initialToken = (0,
|
|
656
|
+
const initialToken = (0, import_vue7.toValue)(options.token);
|
|
594
657
|
const decimals = (0, import_connect_appkit_core5.createDecimalsCache)(initialToken, initialToken.decimals);
|
|
595
|
-
const isSending = (0,
|
|
596
|
-
const error = (0,
|
|
658
|
+
const isSending = (0, import_vue7.shallowRef)(false);
|
|
659
|
+
const error = (0, import_vue7.shallowRef)(null);
|
|
597
660
|
let generation = 0;
|
|
598
661
|
let disposed = false;
|
|
599
|
-
(0,
|
|
662
|
+
(0, import_vue7.watch)(
|
|
600
663
|
[
|
|
601
|
-
() => (0,
|
|
602
|
-
() => (0,
|
|
603
|
-
() => (0,
|
|
604
|
-
() => (0,
|
|
605
|
-
() => (0,
|
|
606
|
-
() => (0,
|
|
607
|
-
() => (0,
|
|
608
|
-
() => (0,
|
|
664
|
+
() => (0, import_vue7.toValue)(options.token).address,
|
|
665
|
+
() => (0, import_vue7.toValue)(options.token).chainId,
|
|
666
|
+
() => (0, import_vue7.toValue)(options.token).decimals,
|
|
667
|
+
() => (0, import_vue7.toValue)(options.account),
|
|
668
|
+
() => (0, import_vue7.toValue)(options.chainId),
|
|
669
|
+
() => (0, import_vue7.toValue)(options.connected),
|
|
670
|
+
() => (0, import_vue7.toValue)(options.publicClient),
|
|
671
|
+
() => (0, import_vue7.unref)(options.sendTransaction)
|
|
609
672
|
],
|
|
610
673
|
() => {
|
|
611
674
|
generation++;
|
|
@@ -616,20 +679,20 @@ function useERC20Transfer(options) {
|
|
|
616
679
|
);
|
|
617
680
|
const sendTransfer = async (to, amount) => {
|
|
618
681
|
const own = ++generation;
|
|
619
|
-
const token = (0,
|
|
620
|
-
const reader = (0,
|
|
682
|
+
const token = (0, import_vue7.toValue)(options.token);
|
|
683
|
+
const reader = (0, import_vue7.toValue)(options.publicClient);
|
|
621
684
|
const stillCurrent = () => !disposed && own === generation;
|
|
622
685
|
error.value = null;
|
|
623
686
|
isSending.value = true;
|
|
624
687
|
try {
|
|
625
688
|
assertErc20Context(
|
|
626
689
|
token,
|
|
627
|
-
(0,
|
|
628
|
-
(0,
|
|
629
|
-
(0,
|
|
690
|
+
(0, import_vue7.toValue)(options.chainId),
|
|
691
|
+
(0, import_vue7.toValue)(options.account),
|
|
692
|
+
(0, import_vue7.toValue)(options.connected)
|
|
630
693
|
);
|
|
631
694
|
if (!reader) {
|
|
632
|
-
throw new
|
|
695
|
+
throw new import_connect_core6.WalletError(
|
|
633
696
|
"wallet_unavailable",
|
|
634
697
|
"No public client available"
|
|
635
698
|
);
|
|
@@ -639,20 +702,20 @@ function useERC20Transfer(options) {
|
|
|
639
702
|
precision = Number(
|
|
640
703
|
await reader.readContract({
|
|
641
704
|
address: token.address,
|
|
642
|
-
abi:
|
|
705
|
+
abi: import_connect_core6.ERC20_MIN_ABI,
|
|
643
706
|
functionName: "decimals"
|
|
644
707
|
})
|
|
645
708
|
);
|
|
646
709
|
if (!stillCurrent()) {
|
|
647
|
-
throw new
|
|
710
|
+
throw new import_connect_core6.WalletError(
|
|
648
711
|
"session_inactive",
|
|
649
712
|
"Wallet or token context changed. Retry the transfer."
|
|
650
713
|
);
|
|
651
714
|
}
|
|
652
715
|
(0, import_connect_appkit_core5.writeDecimals)(decimals, token, precision);
|
|
653
716
|
}
|
|
654
|
-
const data = (0, import_connect_appkit_core5.encodeErc20Transfer)(to, (0,
|
|
655
|
-
return await (0,
|
|
717
|
+
const data = (0, import_connect_appkit_core5.encodeErc20Transfer)(to, (0, import_connect_core6.parseUnits)(amount, precision));
|
|
718
|
+
return await (0, import_vue7.unref)(options.sendTransaction)({
|
|
656
719
|
to: token.address,
|
|
657
720
|
data,
|
|
658
721
|
value: "0"
|
|
@@ -665,7 +728,7 @@ function useERC20Transfer(options) {
|
|
|
665
728
|
if (stillCurrent()) isSending.value = false;
|
|
666
729
|
}
|
|
667
730
|
};
|
|
668
|
-
(0,
|
|
731
|
+
(0, import_vue7.onScopeDispose)(() => {
|
|
669
732
|
disposed = true;
|
|
670
733
|
generation++;
|
|
671
734
|
});
|
|
@@ -674,30 +737,30 @@ function useERC20Transfer(options) {
|
|
|
674
737
|
|
|
675
738
|
// src/useERC20Approve.ts
|
|
676
739
|
var import_connect_appkit_core6 = require("@naculus/connect-appkit-core");
|
|
677
|
-
var
|
|
678
|
-
var
|
|
740
|
+
var import_connect_core7 = require("@naculus/connect-core");
|
|
741
|
+
var import_vue8 = require("vue");
|
|
679
742
|
var MAX_UINT256 = (1n << 256n) - 1n;
|
|
680
743
|
function useERC20Approve(options) {
|
|
681
|
-
const initialToken = (0,
|
|
744
|
+
const initialToken = (0, import_vue8.toValue)(options.token);
|
|
682
745
|
const decimals = (0, import_connect_appkit_core6.createDecimalsCache)(initialToken, initialToken.decimals);
|
|
683
|
-
const allowanceRaw = (0,
|
|
684
|
-
const isApproving = (0,
|
|
685
|
-
const isFetchingAllowance = (0,
|
|
686
|
-
const error = (0,
|
|
746
|
+
const allowanceRaw = (0, import_vue8.shallowRef)(null);
|
|
747
|
+
const isApproving = (0, import_vue8.shallowRef)(false);
|
|
748
|
+
const isFetchingAllowance = (0, import_vue8.shallowRef)(false);
|
|
749
|
+
const error = (0, import_vue8.shallowRef)(null);
|
|
687
750
|
let generation = 0;
|
|
688
751
|
let allowanceGeneration = 0;
|
|
689
752
|
let disposed = false;
|
|
690
|
-
(0,
|
|
753
|
+
(0, import_vue8.watch)(
|
|
691
754
|
[
|
|
692
|
-
() => (0,
|
|
693
|
-
() => (0,
|
|
694
|
-
() => (0,
|
|
695
|
-
() => (0,
|
|
696
|
-
() => (0,
|
|
697
|
-
() => (0,
|
|
698
|
-
() => (0,
|
|
699
|
-
() => (0,
|
|
700
|
-
() => (0,
|
|
755
|
+
() => (0, import_vue8.toValue)(options.token).address,
|
|
756
|
+
() => (0, import_vue8.toValue)(options.token).chainId,
|
|
757
|
+
() => (0, import_vue8.toValue)(options.token).decimals,
|
|
758
|
+
() => (0, import_vue8.toValue)(options.spender),
|
|
759
|
+
() => (0, import_vue8.toValue)(options.account),
|
|
760
|
+
() => (0, import_vue8.toValue)(options.chainId),
|
|
761
|
+
() => (0, import_vue8.toValue)(options.connected),
|
|
762
|
+
() => (0, import_vue8.toValue)(options.publicClient),
|
|
763
|
+
() => (0, import_vue8.unref)(options.sendTransaction)
|
|
701
764
|
],
|
|
702
765
|
() => {
|
|
703
766
|
generation++;
|
|
@@ -710,17 +773,17 @@ function useERC20Approve(options) {
|
|
|
710
773
|
{ flush: "sync" }
|
|
711
774
|
);
|
|
712
775
|
const context = () => {
|
|
713
|
-
const token = (0,
|
|
776
|
+
const token = (0, import_vue8.toValue)(options.token);
|
|
714
777
|
const account = assertErc20Context(
|
|
715
778
|
token,
|
|
716
|
-
(0,
|
|
717
|
-
(0,
|
|
718
|
-
(0,
|
|
779
|
+
(0, import_vue8.toValue)(options.chainId),
|
|
780
|
+
(0, import_vue8.toValue)(options.account),
|
|
781
|
+
(0, import_vue8.toValue)(options.connected)
|
|
719
782
|
);
|
|
720
|
-
const reader = (0,
|
|
783
|
+
const reader = (0, import_vue8.toValue)(options.publicClient);
|
|
721
784
|
if (!reader)
|
|
722
|
-
throw new
|
|
723
|
-
return { token, account, reader, spender: (0,
|
|
785
|
+
throw new import_connect_core7.WalletError("wallet_unavailable", "No public client");
|
|
786
|
+
return { token, account, reader, spender: (0, import_vue8.toValue)(options.spender) };
|
|
724
787
|
};
|
|
725
788
|
const readPrecision = async () => {
|
|
726
789
|
const { token, reader } = context();
|
|
@@ -729,7 +792,7 @@ function useERC20Approve(options) {
|
|
|
729
792
|
precision = Number(
|
|
730
793
|
await reader.readContract({
|
|
731
794
|
address: token.address,
|
|
732
|
-
abi:
|
|
795
|
+
abi: import_connect_core7.ERC20_MIN_ABI,
|
|
733
796
|
functionName: "decimals"
|
|
734
797
|
})
|
|
735
798
|
);
|
|
@@ -747,7 +810,7 @@ function useERC20Approve(options) {
|
|
|
747
810
|
const raw = BigInt(
|
|
748
811
|
await reader.readContract({
|
|
749
812
|
address: token.address,
|
|
750
|
-
abi:
|
|
813
|
+
abi: import_connect_core7.ERC20_MIN_ABI,
|
|
751
814
|
functionName: "allowance",
|
|
752
815
|
args: [account, spender]
|
|
753
816
|
})
|
|
@@ -771,7 +834,7 @@ function useERC20Approve(options) {
|
|
|
771
834
|
isApproving.value = true;
|
|
772
835
|
try {
|
|
773
836
|
const { token, spender } = context();
|
|
774
|
-
const hash = await (0,
|
|
837
|
+
const hash = await (0, import_vue8.unref)(options.sendTransaction)({
|
|
775
838
|
to: token.address,
|
|
776
839
|
data: (0, import_connect_appkit_core6.encodeErc20Approve)(spender, rawAmount),
|
|
777
840
|
value: "0"
|
|
@@ -792,12 +855,12 @@ function useERC20Approve(options) {
|
|
|
792
855
|
try {
|
|
793
856
|
const precision = await readPrecision();
|
|
794
857
|
if (contextGeneration !== generation || disposed) {
|
|
795
|
-
throw new
|
|
858
|
+
throw new import_connect_core7.WalletError(
|
|
796
859
|
"session_inactive",
|
|
797
860
|
"Wallet or token context changed. Retry the approval."
|
|
798
861
|
);
|
|
799
862
|
}
|
|
800
|
-
rawAmount = (0,
|
|
863
|
+
rawAmount = (0, import_connect_core7.parseUnits)(amount, precision);
|
|
801
864
|
} catch (cause) {
|
|
802
865
|
const normalized = cause instanceof Error ? cause : new Error("Approve failed");
|
|
803
866
|
if (!disposed && contextGeneration === generation)
|
|
@@ -810,15 +873,15 @@ function useERC20Approve(options) {
|
|
|
810
873
|
const hasAllowance = async (required) => {
|
|
811
874
|
const raw = allowanceRaw.value ?? await refetchAllowance();
|
|
812
875
|
if (raw === null) return false;
|
|
813
|
-
return raw >= (0,
|
|
876
|
+
return raw >= (0, import_connect_core7.parseUnits)(required, await readPrecision());
|
|
814
877
|
};
|
|
815
|
-
const allowance = (0,
|
|
878
|
+
const allowance = (0, import_vue8.computed)(() => {
|
|
816
879
|
if (allowanceRaw.value === null) return null;
|
|
817
|
-
const token = (0,
|
|
880
|
+
const token = (0, import_vue8.toValue)(options.token);
|
|
818
881
|
const precision = (0, import_connect_appkit_core6.readDecimals)(decimals, token, token.decimals);
|
|
819
|
-
return precision === void 0 ? null : (0,
|
|
882
|
+
return precision === void 0 ? null : (0, import_connect_core7.formatUnits)(allowanceRaw.value, precision);
|
|
820
883
|
});
|
|
821
|
-
(0,
|
|
884
|
+
(0, import_vue8.onScopeDispose)(() => {
|
|
822
885
|
disposed = true;
|
|
823
886
|
generation++;
|
|
824
887
|
allowanceGeneration++;
|
|
@@ -838,20 +901,20 @@ function useERC20Approve(options) {
|
|
|
838
901
|
|
|
839
902
|
// src/useERC20TransferSimulation.ts
|
|
840
903
|
var import_connect_appkit_core7 = require("@naculus/connect-appkit-core");
|
|
841
|
-
var
|
|
842
|
-
var
|
|
904
|
+
var import_connect_core8 = require("@naculus/connect-core");
|
|
905
|
+
var import_vue9 = require("vue");
|
|
843
906
|
function useERC20TransferSimulation(options) {
|
|
844
|
-
const transaction = (0,
|
|
845
|
-
const token = (0,
|
|
846
|
-
if (!(0,
|
|
907
|
+
const transaction = (0, import_vue9.computed)(() => {
|
|
908
|
+
const token = (0, import_vue9.toValue)(options.token);
|
|
909
|
+
if (!(0, import_vue9.toValue)(options.connected) || !(0, import_vue9.toValue)(options.evmAccount))
|
|
847
910
|
return void 0;
|
|
848
911
|
try {
|
|
849
912
|
if (token.decimals === void 0) return void 0;
|
|
850
913
|
return {
|
|
851
914
|
to: token.address,
|
|
852
915
|
data: (0, import_connect_appkit_core7.encodeErc20Transfer)(
|
|
853
|
-
(0,
|
|
854
|
-
(0,
|
|
916
|
+
(0, import_vue9.toValue)(options.to),
|
|
917
|
+
(0, import_connect_core8.parseUnits)((0, import_vue9.toValue)(options.amount), token.decimals)
|
|
855
918
|
),
|
|
856
919
|
value: "0"
|
|
857
920
|
};
|
|
@@ -859,10 +922,10 @@ function useERC20TransferSimulation(options) {
|
|
|
859
922
|
return void 0;
|
|
860
923
|
}
|
|
861
924
|
});
|
|
862
|
-
const chainId = (0,
|
|
863
|
-
const token = (0,
|
|
925
|
+
const chainId = (0, import_vue9.computed)(() => {
|
|
926
|
+
const token = (0, import_vue9.toValue)(options.token);
|
|
864
927
|
if (token.chainId !== void 0) return token.chainId;
|
|
865
|
-
const currentChain = (0,
|
|
928
|
+
const currentChain = (0, import_vue9.toValue)(options.currentChain);
|
|
866
929
|
return currentChain ? (0, import_connect_appkit_core7.chainNumber)(currentChain) ?? void 0 : void 0;
|
|
867
930
|
});
|
|
868
931
|
const simulation = useTransactionSimulation(transaction, {
|
|
@@ -872,39 +935,39 @@ function useERC20TransferSimulation(options) {
|
|
|
872
935
|
evmAccount: options.evmAccount
|
|
873
936
|
});
|
|
874
937
|
return {
|
|
875
|
-
result: (0,
|
|
938
|
+
result: (0, import_vue9.computed)(
|
|
876
939
|
() => transaction.value ? simulation.result.value : void 0
|
|
877
940
|
),
|
|
878
|
-
isSimulating: (0,
|
|
941
|
+
isSimulating: (0, import_vue9.computed)(
|
|
879
942
|
() => !!transaction.value && simulation.isSimulating.value
|
|
880
943
|
),
|
|
881
|
-
error: (0,
|
|
944
|
+
error: (0, import_vue9.computed)(() => transaction.value ? simulation.error.value : null),
|
|
882
945
|
reSimulate: simulation.simulate,
|
|
883
946
|
reset: simulation.reset
|
|
884
947
|
};
|
|
885
948
|
}
|
|
886
949
|
|
|
887
950
|
// src/useAccount.ts
|
|
888
|
-
var
|
|
951
|
+
var import_vue10 = require("vue");
|
|
889
952
|
function useAccount(accounts, connected) {
|
|
890
953
|
const parsed = useAccounts(accounts);
|
|
891
|
-
const isConnected = (0,
|
|
892
|
-
const accountList = (0,
|
|
954
|
+
const isConnected = (0, import_vue10.computed)(() => (0, import_vue10.toValue)(connected));
|
|
955
|
+
const accountList = (0, import_vue10.computed)(() => (0, import_vue10.toValue)(accounts) ?? []);
|
|
893
956
|
return {
|
|
894
|
-
accounts: (0,
|
|
957
|
+
accounts: (0, import_vue10.computed)(
|
|
895
958
|
() => isConnected.value && accountList.value.length > 0 ? parsed.accounts.value : null
|
|
896
959
|
),
|
|
897
|
-
evmAccount: (0,
|
|
960
|
+
evmAccount: (0, import_vue10.computed)(
|
|
898
961
|
() => isConnected.value ? parsed.evmAccount.value : null
|
|
899
962
|
),
|
|
900
|
-
primaryAccount: (0,
|
|
963
|
+
primaryAccount: (0, import_vue10.computed)(() => accountList.value[0] ?? null),
|
|
901
964
|
isConnected,
|
|
902
|
-
count: (0,
|
|
965
|
+
count: (0, import_vue10.computed)(() => accountList.value.length)
|
|
903
966
|
};
|
|
904
967
|
}
|
|
905
968
|
|
|
906
969
|
// src/useSession.ts
|
|
907
|
-
var
|
|
970
|
+
var import_vue11 = require("vue");
|
|
908
971
|
function readSession(manager) {
|
|
909
972
|
const bundle = manager?.getActiveBundle();
|
|
910
973
|
if (!bundle) {
|
|
@@ -923,9 +986,9 @@ function readSession(manager) {
|
|
|
923
986
|
};
|
|
924
987
|
}
|
|
925
988
|
function useSession(manager) {
|
|
926
|
-
const snapshot = (0,
|
|
927
|
-
(0,
|
|
928
|
-
() => (0,
|
|
989
|
+
const snapshot = (0, import_vue11.shallowRef)(readSession((0, import_vue11.toValue)(manager)));
|
|
990
|
+
(0, import_vue11.watch)(
|
|
991
|
+
() => (0, import_vue11.toValue)(manager),
|
|
929
992
|
(current, _previous, onCleanup) => {
|
|
930
993
|
const update = () => {
|
|
931
994
|
snapshot.value = readSession(current);
|
|
@@ -948,29 +1011,29 @@ function useSession(manager) {
|
|
|
948
1011
|
{ immediate: true }
|
|
949
1012
|
);
|
|
950
1013
|
return {
|
|
951
|
-
session: (0,
|
|
952
|
-
chainSessions: (0,
|
|
953
|
-
activeChainId: (0,
|
|
954
|
-
isConnected: (0,
|
|
955
|
-
connectorId: (0,
|
|
1014
|
+
session: (0, import_vue11.computed)(() => snapshot.value.session),
|
|
1015
|
+
chainSessions: (0, import_vue11.computed)(() => snapshot.value.chainSessions),
|
|
1016
|
+
activeChainId: (0, import_vue11.computed)(() => snapshot.value.activeChainId),
|
|
1017
|
+
isConnected: (0, import_vue11.computed)(() => snapshot.value.session !== null),
|
|
1018
|
+
connectorId: (0, import_vue11.computed)(() => snapshot.value.connectorId)
|
|
956
1019
|
};
|
|
957
1020
|
}
|
|
958
1021
|
|
|
959
1022
|
// src/useConnect.ts
|
|
960
|
-
var
|
|
961
|
-
var
|
|
1023
|
+
var import_connect_core9 = require("@naculus/connect-core");
|
|
1024
|
+
var import_vue12 = require("vue");
|
|
962
1025
|
function useConnect(action, status) {
|
|
963
1026
|
const guard = useActionGuard();
|
|
964
1027
|
let inFlight = null;
|
|
965
1028
|
const connect = () => {
|
|
966
1029
|
if (inFlight) return inFlight;
|
|
967
|
-
const invoke = (0,
|
|
1030
|
+
const invoke = (0, import_vue12.unref)(action);
|
|
968
1031
|
const pending = guard.run(
|
|
969
1032
|
() => Promise.resolve().then(() => invoke()),
|
|
970
1033
|
"Connection failed",
|
|
971
1034
|
(cause) => {
|
|
972
1035
|
const message = cause instanceof Error ? cause.message : "Connection failed";
|
|
973
|
-
return cause instanceof
|
|
1036
|
+
return cause instanceof import_connect_core9.WalletError ? cause : new Error(message);
|
|
974
1037
|
}
|
|
975
1038
|
).catch(() => {
|
|
976
1039
|
}).finally(() => {
|
|
@@ -981,22 +1044,22 @@ function useConnect(action, status) {
|
|
|
981
1044
|
};
|
|
982
1045
|
return {
|
|
983
1046
|
connect,
|
|
984
|
-
isConnecting: (0,
|
|
985
|
-
() => guard.busy.value || (0,
|
|
1047
|
+
isConnecting: (0, import_vue12.computed)(
|
|
1048
|
+
() => guard.busy.value || (0, import_vue12.toValue)(status) === "connecting"
|
|
986
1049
|
),
|
|
987
1050
|
error: guard.error
|
|
988
1051
|
};
|
|
989
1052
|
}
|
|
990
1053
|
|
|
991
1054
|
// src/useDisconnect.ts
|
|
992
|
-
var
|
|
1055
|
+
var import_vue13 = require("vue");
|
|
993
1056
|
function useDisconnect(action, status) {
|
|
994
1057
|
const guard = useActionGuard();
|
|
995
1058
|
let inFlight = null;
|
|
996
1059
|
const disconnect = () => {
|
|
997
1060
|
if (inFlight) return inFlight;
|
|
998
|
-
if ((0,
|
|
999
|
-
const invoke = (0,
|
|
1061
|
+
if ((0, import_vue13.toValue)(status) === "disconnected") return Promise.resolve();
|
|
1062
|
+
const invoke = (0, import_vue13.unref)(action);
|
|
1000
1063
|
const pending = guard.run(() => Promise.resolve().then(() => invoke()), "Disconnect failed").catch(() => {
|
|
1001
1064
|
}).finally(() => {
|
|
1002
1065
|
if (inFlight === pending) inFlight = null;
|
|
@@ -1017,11 +1080,11 @@ function useDisconnect(action, status) {
|
|
|
1017
1080
|
|
|
1018
1081
|
// src/useSwitchChain.ts
|
|
1019
1082
|
var import_connect_appkit_core8 = require("@naculus/connect-appkit-core");
|
|
1020
|
-
var
|
|
1083
|
+
var import_vue14 = require("vue");
|
|
1021
1084
|
function useSwitchChain(action, chainId) {
|
|
1022
1085
|
const guard = useActionGuard();
|
|
1023
1086
|
const switchChain = (targetChainId) => {
|
|
1024
|
-
const invoke = (0,
|
|
1087
|
+
const invoke = (0, import_vue14.unref)(action);
|
|
1025
1088
|
return guard.run(async () => {
|
|
1026
1089
|
try {
|
|
1027
1090
|
await invoke(targetChainId);
|
|
@@ -1033,18 +1096,18 @@ function useSwitchChain(action, chainId) {
|
|
|
1033
1096
|
return {
|
|
1034
1097
|
switchChain,
|
|
1035
1098
|
isSwitching: guard.busy,
|
|
1036
|
-
currentChainId: (0,
|
|
1099
|
+
currentChainId: (0, import_vue14.computed)(() => (0, import_vue14.toValue)(chainId) ?? null),
|
|
1037
1100
|
error: guard.error,
|
|
1038
1101
|
clearError: guard.clearError
|
|
1039
1102
|
};
|
|
1040
1103
|
}
|
|
1041
1104
|
|
|
1042
1105
|
// src/useSignMessage.ts
|
|
1043
|
-
var
|
|
1106
|
+
var import_vue15 = require("vue");
|
|
1044
1107
|
function useSignMessage(action) {
|
|
1045
1108
|
const guard = useActionGuard();
|
|
1046
1109
|
const signMessage = (message) => {
|
|
1047
|
-
const invoke = (0,
|
|
1110
|
+
const invoke = (0, import_vue15.unref)(action);
|
|
1048
1111
|
return guard.run(() => invoke(message), "Signing failed");
|
|
1049
1112
|
};
|
|
1050
1113
|
return {
|
|
@@ -1056,12 +1119,12 @@ function useSignMessage(action) {
|
|
|
1056
1119
|
}
|
|
1057
1120
|
|
|
1058
1121
|
// src/useSendTransaction.ts
|
|
1059
|
-
var
|
|
1122
|
+
var import_vue16 = require("vue");
|
|
1060
1123
|
function useSendTransaction(action) {
|
|
1061
1124
|
const guard = useActionGuard();
|
|
1062
|
-
const status = (0,
|
|
1125
|
+
const status = (0, import_vue16.shallowRef)("idle");
|
|
1063
1126
|
const sendTransaction = (transaction) => {
|
|
1064
|
-
const invoke = (0,
|
|
1127
|
+
const invoke = (0, import_vue16.unref)(action);
|
|
1065
1128
|
status.value = "awaiting_approval";
|
|
1066
1129
|
return guard.run(async (commit) => {
|
|
1067
1130
|
const hash = await invoke(transaction);
|
|
@@ -1083,20 +1146,20 @@ function useSendTransaction(action) {
|
|
|
1083
1146
|
status,
|
|
1084
1147
|
error: guard.error,
|
|
1085
1148
|
reset,
|
|
1086
|
-
isSending: (0,
|
|
1149
|
+
isSending: (0, import_vue16.computed)(() => status.value === "awaiting_approval")
|
|
1087
1150
|
};
|
|
1088
1151
|
}
|
|
1089
1152
|
|
|
1090
1153
|
// src/useSolanaTransaction.ts
|
|
1091
|
-
var
|
|
1154
|
+
var import_vue17 = require("vue");
|
|
1092
1155
|
function useSolanaTransaction(options) {
|
|
1093
1156
|
const guard = useActionGuard();
|
|
1094
|
-
const isSigning = (0,
|
|
1095
|
-
const isSending = (0,
|
|
1157
|
+
const isSigning = (0, import_vue17.shallowRef)(false);
|
|
1158
|
+
const isSending = (0, import_vue17.shallowRef)(false);
|
|
1096
1159
|
let signing = 0;
|
|
1097
1160
|
let sending = 0;
|
|
1098
1161
|
const signTransaction = (transaction) => {
|
|
1099
|
-
const invoke = (0,
|
|
1162
|
+
const invoke = (0, import_vue17.unref)(options.signTransaction);
|
|
1100
1163
|
signing++;
|
|
1101
1164
|
isSigning.value = true;
|
|
1102
1165
|
return guard.run(() => invoke(transaction), "Signing failed").finally(() => {
|
|
@@ -1105,7 +1168,7 @@ function useSolanaTransaction(options) {
|
|
|
1105
1168
|
});
|
|
1106
1169
|
};
|
|
1107
1170
|
const sendTransaction = (transaction) => {
|
|
1108
|
-
const invoke = (0,
|
|
1171
|
+
const invoke = (0, import_vue17.unref)(options.sendTransaction);
|
|
1109
1172
|
sending++;
|
|
1110
1173
|
isSending.value = true;
|
|
1111
1174
|
return guard.run(() => invoke(transaction), "Send failed").finally(() => {
|
|
@@ -1113,7 +1176,7 @@ function useSolanaTransaction(options) {
|
|
|
1113
1176
|
isSending.value = sending > 0;
|
|
1114
1177
|
});
|
|
1115
1178
|
};
|
|
1116
|
-
const getStatus = (signature) => (0,
|
|
1179
|
+
const getStatus = (signature) => (0, import_vue17.unref)(options.getStatus)(signature);
|
|
1117
1180
|
return {
|
|
1118
1181
|
signTransaction,
|
|
1119
1182
|
sendTransaction,
|
|
@@ -1126,12 +1189,12 @@ function useSolanaTransaction(options) {
|
|
|
1126
1189
|
}
|
|
1127
1190
|
|
|
1128
1191
|
// src/useSignInWithX.ts
|
|
1129
|
-
var
|
|
1192
|
+
var import_vue18 = require("vue");
|
|
1130
1193
|
function useSignInWithX(action) {
|
|
1131
1194
|
const guard = useActionGuard();
|
|
1132
|
-
const result = (0,
|
|
1195
|
+
const result = (0, import_vue18.shallowRef)(null);
|
|
1133
1196
|
const signIn = (options) => {
|
|
1134
|
-
const invoke = (0,
|
|
1197
|
+
const invoke = (0, import_vue18.unref)(action);
|
|
1135
1198
|
return guard.run(async (commit) => {
|
|
1136
1199
|
const next = await invoke(options);
|
|
1137
1200
|
commit(() => {
|
|
@@ -1160,48 +1223,48 @@ function useSignInWithEthereum(action) {
|
|
|
1160
1223
|
}
|
|
1161
1224
|
|
|
1162
1225
|
// src/useExecuteCalls.ts
|
|
1163
|
-
var
|
|
1226
|
+
var import_vue19 = require("vue");
|
|
1164
1227
|
function useExecuteCalls(options) {
|
|
1165
1228
|
const guard = useActionGuard();
|
|
1166
|
-
const preview = (callCount, atomicity) => (0,
|
|
1229
|
+
const preview = (callCount, atomicity) => (0, import_vue19.unref)(options.preview)(callCount, atomicity);
|
|
1167
1230
|
const execute = (calls, atomicity) => {
|
|
1168
|
-
const invoke = (0,
|
|
1231
|
+
const invoke = (0, import_vue19.unref)(options.execute);
|
|
1169
1232
|
return guard.run(() => invoke(calls, atomicity), "Execution failed");
|
|
1170
1233
|
};
|
|
1171
1234
|
const reset = () => {
|
|
1172
1235
|
guard.reset();
|
|
1173
|
-
(0,
|
|
1236
|
+
(0, import_vue19.unref)(options.reset)();
|
|
1174
1237
|
};
|
|
1175
1238
|
return {
|
|
1176
1239
|
preview,
|
|
1177
1240
|
execute,
|
|
1178
1241
|
isExecuting: guard.busy,
|
|
1179
1242
|
error: guard.error,
|
|
1180
|
-
lastRoute: (0,
|
|
1243
|
+
lastRoute: (0, import_vue19.computed)(() => (0, import_vue19.toValue)(options.lastRoute)),
|
|
1181
1244
|
reset
|
|
1182
1245
|
};
|
|
1183
1246
|
}
|
|
1184
1247
|
|
|
1185
1248
|
// src/useDelegationPolicy.ts
|
|
1186
1249
|
var import_connect_appkit_core10 = require("@naculus/connect-appkit-core");
|
|
1187
|
-
var
|
|
1250
|
+
var import_vue21 = require("vue");
|
|
1188
1251
|
|
|
1189
1252
|
// src/useSessionKeys.ts
|
|
1190
1253
|
var import_connect_appkit_core9 = require("@naculus/connect-appkit-core");
|
|
1191
|
-
var
|
|
1254
|
+
var import_vue20 = require("vue");
|
|
1192
1255
|
function resolveManager(config, options) {
|
|
1193
1256
|
return options.manager ?? (0, import_connect_appkit_core9.getSharedSessionKeyManager)(config);
|
|
1194
1257
|
}
|
|
1195
1258
|
function useSessionKeys(connected, config, options = {}) {
|
|
1196
1259
|
const manager = resolveManager(config, options);
|
|
1197
|
-
const sessions = (0,
|
|
1198
|
-
const loading = (0,
|
|
1199
|
-
const error = (0,
|
|
1260
|
+
const sessions = (0, import_vue20.shallowRef)([]);
|
|
1261
|
+
const loading = (0, import_vue20.shallowRef)(false);
|
|
1262
|
+
const error = (0, import_vue20.shallowRef)(null);
|
|
1200
1263
|
let generation = 0;
|
|
1201
1264
|
let disposed = false;
|
|
1202
1265
|
const refresh = async () => {
|
|
1203
1266
|
const own = ++generation;
|
|
1204
|
-
if (!(0,
|
|
1267
|
+
if (!(0, import_vue20.toValue)(connected)) {
|
|
1205
1268
|
sessions.value = [];
|
|
1206
1269
|
return;
|
|
1207
1270
|
}
|
|
@@ -1218,20 +1281,20 @@ function useSessionKeys(connected, config, options = {}) {
|
|
|
1218
1281
|
if (!disposed && own === generation) loading.value = false;
|
|
1219
1282
|
}
|
|
1220
1283
|
};
|
|
1221
|
-
(0,
|
|
1222
|
-
() => (0,
|
|
1284
|
+
(0, import_vue20.watch)(
|
|
1285
|
+
() => (0, import_vue20.toValue)(connected),
|
|
1223
1286
|
() => {
|
|
1224
1287
|
void refresh();
|
|
1225
1288
|
},
|
|
1226
1289
|
{ immediate: true }
|
|
1227
1290
|
);
|
|
1228
|
-
(0,
|
|
1291
|
+
(0, import_vue20.onScopeDispose)(() => {
|
|
1229
1292
|
disposed = true;
|
|
1230
1293
|
generation++;
|
|
1231
1294
|
});
|
|
1232
1295
|
return {
|
|
1233
1296
|
sessions,
|
|
1234
|
-
activeSessions: (0,
|
|
1297
|
+
activeSessions: (0, import_vue20.computed)(
|
|
1235
1298
|
() => sessions.value.filter((s) => s.status === "active")
|
|
1236
1299
|
),
|
|
1237
1300
|
loading,
|
|
@@ -1246,7 +1309,7 @@ function useSessionKeys(connected, config, options = {}) {
|
|
|
1246
1309
|
function useCreateSessionKey(config, options = {}) {
|
|
1247
1310
|
const manager = resolveManager(config, options);
|
|
1248
1311
|
const guard = useActionGuard();
|
|
1249
|
-
const lastCreated = (0,
|
|
1312
|
+
const lastCreated = (0, import_vue20.shallowRef)(null);
|
|
1250
1313
|
return {
|
|
1251
1314
|
createSessionKey: (scope, signerAddress) => guard.run(async () => {
|
|
1252
1315
|
const info = await manager.createSessionKey(scope, signerAddress);
|
|
@@ -1297,31 +1360,31 @@ function useDelegationPolicy(options) {
|
|
|
1297
1360
|
manager
|
|
1298
1361
|
});
|
|
1299
1362
|
const guard = useActionGuard();
|
|
1300
|
-
const verifiedIds = (0,
|
|
1301
|
-
const isVerifying = (0,
|
|
1302
|
-
const verifyError = (0,
|
|
1363
|
+
const verifiedIds = (0, import_vue21.shallowRef)(/* @__PURE__ */ new Set());
|
|
1364
|
+
const isVerifying = (0, import_vue21.shallowRef)(false);
|
|
1365
|
+
const verifyError = (0, import_vue21.shallowRef)(null);
|
|
1303
1366
|
let verifyGeneration = 0;
|
|
1304
1367
|
let disposed = false;
|
|
1305
1368
|
const origin = options.origin ?? (typeof window !== "undefined" ? window.location.origin : "unknown");
|
|
1306
1369
|
const flow = (0, import_connect_appkit_core10.createDelegationPolicyFlow)({
|
|
1307
1370
|
manager,
|
|
1308
1371
|
origin,
|
|
1309
|
-
signer: () => (0, import_connect_appkit_core10.bareEvmAddress)((0,
|
|
1310
|
-
signMessage: (message) => (0,
|
|
1311
|
-
verifySignature: (input) => (0,
|
|
1312
|
-
previewExecution: (callCount, atomicity) => (0,
|
|
1372
|
+
signer: () => (0, import_connect_appkit_core10.bareEvmAddress)((0, import_vue21.toValue)(options.account)),
|
|
1373
|
+
signMessage: (message) => (0, import_vue21.unref)(options.signMessage)(message),
|
|
1374
|
+
verifySignature: (input) => (0, import_vue21.unref)(options.verifySignature)(input),
|
|
1375
|
+
previewExecution: (callCount, atomicity) => (0, import_vue21.unref)(options.previewExecution)(callCount, atomicity),
|
|
1313
1376
|
sponsorship: options.sponsorship,
|
|
1314
1377
|
adapter: options.adapter,
|
|
1315
|
-
signTypedData: options.signTypedData ? (typedData) => (0,
|
|
1378
|
+
signTypedData: options.signTypedData ? (typedData) => (0, import_vue21.unref)(
|
|
1316
1379
|
options.signTypedData
|
|
1317
1380
|
)(typedData) : void 0,
|
|
1318
|
-
chainId: () => (0,
|
|
1319
|
-
delegation: () => (0,
|
|
1381
|
+
chainId: () => (0, import_vue21.toValue)(options.chainId) ?? null,
|
|
1382
|
+
delegation: () => (0, import_vue21.toValue)(options.delegation),
|
|
1320
1383
|
encryptionKeyConfigured: Boolean(options.managerConfig?.encryptionKey),
|
|
1321
1384
|
storageAvailable: () => sessionKeys.storageAvailable,
|
|
1322
1385
|
refresh: sessionKeys.refresh
|
|
1323
1386
|
});
|
|
1324
|
-
(0,
|
|
1387
|
+
(0, import_vue21.watch)(
|
|
1325
1388
|
() => sessionKeys.sessions.value,
|
|
1326
1389
|
(sessions) => {
|
|
1327
1390
|
const own = ++verifyGeneration;
|
|
@@ -1351,21 +1414,21 @@ function useDelegationPolicy(options) {
|
|
|
1351
1414
|
},
|
|
1352
1415
|
{ immediate: true }
|
|
1353
1416
|
);
|
|
1354
|
-
(0,
|
|
1417
|
+
(0, import_vue21.onScopeDispose)(() => {
|
|
1355
1418
|
disposed = true;
|
|
1356
1419
|
verifyGeneration++;
|
|
1357
1420
|
});
|
|
1358
1421
|
return {
|
|
1359
1422
|
policies: sessionKeys.sessions,
|
|
1360
|
-
activePolicies: (0,
|
|
1423
|
+
activePolicies: (0, import_vue21.computed)(
|
|
1361
1424
|
() => sessionKeys.activeSessions.value.filter(
|
|
1362
1425
|
(p) => verifiedIds.value.has(p.id)
|
|
1363
1426
|
)
|
|
1364
1427
|
),
|
|
1365
1428
|
storageAvailable: sessionKeys.storageAvailable,
|
|
1366
|
-
loading: (0,
|
|
1429
|
+
loading: (0, import_vue21.computed)(() => sessionKeys.loading.value || isVerifying.value),
|
|
1367
1430
|
isBusy: guard.busy,
|
|
1368
|
-
error: (0,
|
|
1431
|
+
error: (0, import_vue21.computed)(
|
|
1369
1432
|
() => guard.error.value ?? verifyError.value ?? sessionKeys.error.value
|
|
1370
1433
|
),
|
|
1371
1434
|
createPolicy: (scope) => guard.run(() => flow.createPolicy(scope), "Policy creation failed"),
|
|
@@ -1387,28 +1450,28 @@ function useDelegationPolicy(options) {
|
|
|
1387
1450
|
|
|
1388
1451
|
// src/useSmartAccount.ts
|
|
1389
1452
|
var import_connect_appkit_core11 = require("@naculus/connect-appkit-core");
|
|
1390
|
-
var
|
|
1391
|
-
var
|
|
1453
|
+
var import_connect_core10 = require("@naculus/connect-core");
|
|
1454
|
+
var import_vue22 = require("vue");
|
|
1392
1455
|
function useSmartAccount(options) {
|
|
1393
|
-
const address = (0,
|
|
1394
|
-
const isDeployed = (0,
|
|
1395
|
-
const accountInfo = (0,
|
|
1456
|
+
const address = (0, import_vue22.shallowRef)(null);
|
|
1457
|
+
const isDeployed = (0, import_vue22.shallowRef)(false);
|
|
1458
|
+
const accountInfo = (0, import_vue22.shallowRef)(null);
|
|
1396
1459
|
const guard = useActionGuard();
|
|
1397
|
-
const managerRef = (0,
|
|
1460
|
+
const managerRef = (0, import_vue22.shallowRef)(null);
|
|
1398
1461
|
let generation = 0;
|
|
1399
1462
|
let inFlight = false;
|
|
1400
1463
|
let disposed = false;
|
|
1401
|
-
const chainId = (0,
|
|
1464
|
+
const chainId = (0, import_vue22.computed)(
|
|
1402
1465
|
() => (0, import_connect_appkit_core11.resolveEvmChainId)(
|
|
1403
|
-
(0,
|
|
1404
|
-
(0,
|
|
1466
|
+
(0, import_vue22.toValue)(options.chainId),
|
|
1467
|
+
(0, import_vue22.toValue)(options.connectedChainId)
|
|
1405
1468
|
)
|
|
1406
1469
|
);
|
|
1407
|
-
(0,
|
|
1470
|
+
(0, import_vue22.watch)(
|
|
1408
1471
|
[
|
|
1409
|
-
() => (0,
|
|
1410
|
-
() => (0,
|
|
1411
|
-
() => (0,
|
|
1472
|
+
() => (0, import_vue22.toValue)(options.manager),
|
|
1473
|
+
() => (0, import_vue22.toValue)(options.rpcUrl),
|
|
1474
|
+
() => (0, import_vue22.toValue)(options.bundlerUrl),
|
|
1412
1475
|
() => chainId.value
|
|
1413
1476
|
],
|
|
1414
1477
|
([supplied, rpcUrl, bundlerUrl, chain]) => {
|
|
@@ -1433,8 +1496,8 @@ function useSmartAccount(options) {
|
|
|
1433
1496
|
},
|
|
1434
1497
|
{ immediate: true }
|
|
1435
1498
|
);
|
|
1436
|
-
const config = (0,
|
|
1437
|
-
const owner = (0, import_connect_appkit_core11.bareEvmAddress)((0,
|
|
1499
|
+
const config = (0, import_vue22.computed)(() => {
|
|
1500
|
+
const owner = (0, import_connect_appkit_core11.bareEvmAddress)((0, import_vue22.toValue)(options.account));
|
|
1438
1501
|
const chain = chainId.value;
|
|
1439
1502
|
if (!owner || !chain || !managerRef.value) return null;
|
|
1440
1503
|
return (0, import_connect_appkit_core11.buildSmartAccountConfig)(owner, chain, {
|
|
@@ -1484,9 +1547,9 @@ function useSmartAccount(options) {
|
|
|
1484
1547
|
return info;
|
|
1485
1548
|
}, "Failed to create smart account");
|
|
1486
1549
|
const deployWallet = () => operate(async (manager, cfg, commit) => {
|
|
1487
|
-
const send = (0,
|
|
1550
|
+
const send = (0, import_vue22.unref)(options.sendTransaction);
|
|
1488
1551
|
if (!send) {
|
|
1489
|
-
throw new
|
|
1552
|
+
throw new import_connect_core10.WalletError(
|
|
1490
1553
|
"wallet_unavailable",
|
|
1491
1554
|
"deployWallet needs the connected wallet's sendTransaction"
|
|
1492
1555
|
);
|
|
@@ -1514,7 +1577,7 @@ function useSmartAccount(options) {
|
|
|
1514
1577
|
});
|
|
1515
1578
|
return addr;
|
|
1516
1579
|
}, "Failed to get smart account address");
|
|
1517
|
-
(0,
|
|
1580
|
+
(0, import_vue22.onScopeDispose)(() => {
|
|
1518
1581
|
disposed = true;
|
|
1519
1582
|
generation++;
|
|
1520
1583
|
});
|
|
@@ -1533,14 +1596,14 @@ function useSmartAccount(options) {
|
|
|
1533
1596
|
|
|
1534
1597
|
// src/useSendUserOperation.ts
|
|
1535
1598
|
var import_connect_appkit_core12 = require("@naculus/connect-appkit-core");
|
|
1536
|
-
var
|
|
1537
|
-
var
|
|
1599
|
+
var import_connect_core11 = require("@naculus/connect-core");
|
|
1600
|
+
var import_vue23 = require("vue");
|
|
1538
1601
|
function useSendUserOperation(options) {
|
|
1539
|
-
const userOpHash = (0,
|
|
1540
|
-
const receipt = (0,
|
|
1541
|
-
const isPending = (0,
|
|
1542
|
-
const isEstimating = (0,
|
|
1543
|
-
const error = (0,
|
|
1602
|
+
const userOpHash = (0, import_vue23.shallowRef)(null);
|
|
1603
|
+
const receipt = (0, import_vue23.shallowRef)(null);
|
|
1604
|
+
const isPending = (0, import_vue23.shallowRef)(false);
|
|
1605
|
+
const isEstimating = (0, import_vue23.shallowRef)(false);
|
|
1606
|
+
const error = (0, import_vue23.shallowRef)(null);
|
|
1544
1607
|
let requestId = 0;
|
|
1545
1608
|
let inFlight = false;
|
|
1546
1609
|
let disposed = false;
|
|
@@ -1549,8 +1612,8 @@ function useSendUserOperation(options) {
|
|
|
1549
1612
|
return null;
|
|
1550
1613
|
};
|
|
1551
1614
|
const sendUserOp = async (calls, opts) => {
|
|
1552
|
-
const rpcUrl = (0,
|
|
1553
|
-
const bundlerUrl = (0,
|
|
1615
|
+
const rpcUrl = (0, import_vue23.toValue)(options.rpcUrl);
|
|
1616
|
+
const bundlerUrl = (0, import_vue23.toValue)(options.bundlerUrl);
|
|
1554
1617
|
if (!rpcUrl) return fail(new Error("RPC URL not configured"));
|
|
1555
1618
|
if (!bundlerUrl) return fail(new Error("Bundler URL not configured"));
|
|
1556
1619
|
if (!calls.length) return fail(new Error("At least one call is required"));
|
|
@@ -1558,23 +1621,23 @@ function useSendUserOperation(options) {
|
|
|
1558
1621
|
return fail(new Error("A UserOperation is already in progress"));
|
|
1559
1622
|
}
|
|
1560
1623
|
const owner = (0, import_connect_appkit_core12.bareEvmAddress)(
|
|
1561
|
-
(0,
|
|
1624
|
+
(0, import_vue23.toValue)(options.owner) ?? (0, import_vue23.toValue)(options.account)
|
|
1562
1625
|
);
|
|
1563
1626
|
if (!owner) {
|
|
1564
1627
|
return fail(
|
|
1565
|
-
new
|
|
1628
|
+
new import_connect_core11.WalletError("wallet_unavailable", "No EVM account found")
|
|
1566
1629
|
);
|
|
1567
1630
|
}
|
|
1568
1631
|
let targetChainId;
|
|
1569
1632
|
try {
|
|
1570
1633
|
targetChainId = (0, import_connect_appkit_core12.resolveUserOpChain)(
|
|
1571
|
-
(0,
|
|
1572
|
-
(0,
|
|
1634
|
+
(0, import_vue23.toValue)(options.chainId),
|
|
1635
|
+
(0, import_vue23.toValue)(options.connectedChainId)
|
|
1573
1636
|
);
|
|
1574
1637
|
} catch (chainError) {
|
|
1575
1638
|
return fail(chainError);
|
|
1576
1639
|
}
|
|
1577
|
-
const signer = (0,
|
|
1640
|
+
const signer = (0, import_vue23.unref)(options.signer);
|
|
1578
1641
|
const own = ++requestId;
|
|
1579
1642
|
inFlight = true;
|
|
1580
1643
|
isPending.value = true;
|
|
@@ -1625,7 +1688,7 @@ function useSendUserOperation(options) {
|
|
|
1625
1688
|
isEstimating.value = false;
|
|
1626
1689
|
error.value = null;
|
|
1627
1690
|
};
|
|
1628
|
-
(0,
|
|
1691
|
+
(0, import_vue23.onScopeDispose)(() => {
|
|
1629
1692
|
disposed = true;
|
|
1630
1693
|
requestId++;
|
|
1631
1694
|
});
|
|
@@ -1642,15 +1705,15 @@ function useSendUserOperation(options) {
|
|
|
1642
1705
|
|
|
1643
1706
|
// src/useUserOpStatus.ts
|
|
1644
1707
|
var import_connect_appkit_core13 = require("@naculus/connect-appkit-core");
|
|
1645
|
-
var
|
|
1708
|
+
var import_vue24 = require("vue");
|
|
1646
1709
|
function useUserOpStatus(options) {
|
|
1647
|
-
const status = (0,
|
|
1648
|
-
const receipt = (0,
|
|
1649
|
-
const userOpHash = (0,
|
|
1650
|
-
const error = (0,
|
|
1651
|
-
const isPolling = (0,
|
|
1652
|
-
const elapsedMs = (0,
|
|
1653
|
-
const attempts = (0,
|
|
1710
|
+
const status = (0, import_vue24.shallowRef)("idle");
|
|
1711
|
+
const receipt = (0, import_vue24.shallowRef)(null);
|
|
1712
|
+
const userOpHash = (0, import_vue24.shallowRef)(null);
|
|
1713
|
+
const error = (0, import_vue24.shallowRef)(null);
|
|
1714
|
+
const isPolling = (0, import_vue24.shallowRef)(false);
|
|
1715
|
+
const elapsedMs = (0, import_vue24.shallowRef)(0);
|
|
1716
|
+
const attempts = (0, import_vue24.shallowRef)(0);
|
|
1654
1717
|
const pollInterval = options.pollInterval ?? 2e3;
|
|
1655
1718
|
const maxRetries = options.maxRetries ?? 30;
|
|
1656
1719
|
let generation = 0;
|
|
@@ -1671,7 +1734,7 @@ function useUserOpStatus(options) {
|
|
|
1671
1734
|
clearTimers();
|
|
1672
1735
|
};
|
|
1673
1736
|
const poll = async (hash, own) => {
|
|
1674
|
-
const bundlerUrl = (0,
|
|
1737
|
+
const bundlerUrl = (0, import_vue24.toValue)(options.bundlerUrl);
|
|
1675
1738
|
if (!bundlerUrl || own !== generation) return;
|
|
1676
1739
|
const attempt = ++attempts.value;
|
|
1677
1740
|
const abort = new AbortController();
|
|
@@ -1728,7 +1791,7 @@ function useUserOpStatus(options) {
|
|
|
1728
1791
|
error.value = null;
|
|
1729
1792
|
attempts.value = 0;
|
|
1730
1793
|
elapsedMs.value = 0;
|
|
1731
|
-
if (!(0,
|
|
1794
|
+
if (!(0, import_vue24.toValue)(options.bundlerUrl)) {
|
|
1732
1795
|
finish("not_found", new Error("Bundler URL not configured"));
|
|
1733
1796
|
return;
|
|
1734
1797
|
}
|
|
@@ -1756,7 +1819,7 @@ function useUserOpStatus(options) {
|
|
|
1756
1819
|
attempts.value = 0;
|
|
1757
1820
|
elapsedMs.value = 0;
|
|
1758
1821
|
};
|
|
1759
|
-
(0,
|
|
1822
|
+
(0, import_vue24.onScopeDispose)(stop);
|
|
1760
1823
|
return {
|
|
1761
1824
|
status,
|
|
1762
1825
|
receipt,
|
|
@@ -1772,17 +1835,17 @@ function useUserOpStatus(options) {
|
|
|
1772
1835
|
}
|
|
1773
1836
|
|
|
1774
1837
|
// src/useSendCalls.ts
|
|
1775
|
-
var
|
|
1838
|
+
var import_vue25 = require("vue");
|
|
1776
1839
|
function useSendCalls(options) {
|
|
1777
|
-
const status = (0,
|
|
1778
|
-
const error = (0,
|
|
1779
|
-
const batchHash = (0,
|
|
1780
|
-
const callsStatus = (0,
|
|
1840
|
+
const status = (0, import_vue25.shallowRef)("idle");
|
|
1841
|
+
const error = (0, import_vue25.shallowRef)(null);
|
|
1842
|
+
const batchHash = (0, import_vue25.shallowRef)(null);
|
|
1843
|
+
const callsStatus = (0, import_vue25.shallowRef)(null);
|
|
1781
1844
|
let sendGeneration = 0;
|
|
1782
1845
|
let statusGeneration = 0;
|
|
1783
1846
|
let disposed = false;
|
|
1784
1847
|
const sendCalls = async (calls, input) => {
|
|
1785
|
-
const invoke = (0,
|
|
1848
|
+
const invoke = (0, import_vue25.unref)(options.sendCalls);
|
|
1786
1849
|
const own = ++sendGeneration;
|
|
1787
1850
|
status.value = "awaiting_approval";
|
|
1788
1851
|
error.value = null;
|
|
@@ -1804,13 +1867,13 @@ function useSendCalls(options) {
|
|
|
1804
1867
|
}
|
|
1805
1868
|
};
|
|
1806
1869
|
const getCallsStatus = async (hash) => {
|
|
1807
|
-
const invoke = (0,
|
|
1870
|
+
const invoke = (0, import_vue25.unref)(options.getCallsStatus);
|
|
1808
1871
|
const own = ++statusGeneration;
|
|
1809
1872
|
const result = await invoke(hash);
|
|
1810
1873
|
if (!disposed && own === statusGeneration) callsStatus.value = result;
|
|
1811
1874
|
return result;
|
|
1812
1875
|
};
|
|
1813
|
-
const showCallsStatus = (hash) => (0,
|
|
1876
|
+
const showCallsStatus = (hash) => (0, import_vue25.unref)(options.showCallsStatus)(hash);
|
|
1814
1877
|
const reset = () => {
|
|
1815
1878
|
sendGeneration++;
|
|
1816
1879
|
statusGeneration++;
|
|
@@ -1819,7 +1882,7 @@ function useSendCalls(options) {
|
|
|
1819
1882
|
batchHash.value = null;
|
|
1820
1883
|
callsStatus.value = null;
|
|
1821
1884
|
};
|
|
1822
|
-
(0,
|
|
1885
|
+
(0, import_vue25.onScopeDispose)(() => {
|
|
1823
1886
|
disposed = true;
|
|
1824
1887
|
sendGeneration++;
|
|
1825
1888
|
statusGeneration++;
|
|
@@ -1832,38 +1895,38 @@ function useSendCalls(options) {
|
|
|
1832
1895
|
error,
|
|
1833
1896
|
batchHash,
|
|
1834
1897
|
callsStatus,
|
|
1835
|
-
execution: (0,
|
|
1836
|
-
isSending: (0,
|
|
1898
|
+
execution: (0, import_vue25.computed)(() => (0, import_vue25.toValue)(options.execution) ?? null),
|
|
1899
|
+
isSending: (0, import_vue25.computed)(() => status.value === "awaiting_approval"),
|
|
1837
1900
|
reset
|
|
1838
1901
|
};
|
|
1839
1902
|
}
|
|
1840
1903
|
|
|
1841
1904
|
// src/useEmbeddedWallet.ts
|
|
1842
|
-
var
|
|
1905
|
+
var import_vue26 = require("vue");
|
|
1843
1906
|
function useEmbeddedWallet(options) {
|
|
1844
1907
|
const guard = useActionGuard();
|
|
1845
1908
|
const run = (action) => guard.run(action, "Embedded wallet action failed");
|
|
1846
|
-
const wallet = (0,
|
|
1909
|
+
const wallet = (0, import_vue26.computed)(() => (0, import_vue26.toValue)(options.wallet));
|
|
1847
1910
|
return {
|
|
1848
1911
|
wallet,
|
|
1849
|
-
hasWallet: (0,
|
|
1850
|
-
address: (0,
|
|
1851
|
-
accounts: (0,
|
|
1852
|
-
activeNamespace: (0,
|
|
1853
|
-
backupPending: (0,
|
|
1854
|
-
storageSecurityLevel: (0,
|
|
1855
|
-
securityReport: (0,
|
|
1856
|
-
connectEmbedded: () => run(() => (0,
|
|
1857
|
-
restoreWallet: () => run(() => (0,
|
|
1858
|
-
generateWallet: () => run(() => (0,
|
|
1859
|
-
importFromMnemonic: (value) => run(() => (0,
|
|
1860
|
-
importFromPrivateKey: (value) => run(() => (0,
|
|
1861
|
-
wipe: () => run(() => (0,
|
|
1862
|
-
setActiveNamespace: (value) => (0,
|
|
1863
|
-
backfillAccounts: () => run(() => (0,
|
|
1864
|
-
getSeedPhrase: () => (0,
|
|
1865
|
-
getPrivateKey: () => (0,
|
|
1866
|
-
confirmBackup: () => (0,
|
|
1912
|
+
hasWallet: (0, import_vue26.computed)(() => wallet.value !== null),
|
|
1913
|
+
address: (0, import_vue26.computed)(() => wallet.value?.address ?? null),
|
|
1914
|
+
accounts: (0, import_vue26.computed)(() => wallet.value?.accounts ?? []),
|
|
1915
|
+
activeNamespace: (0, import_vue26.computed)(() => wallet.value?.activeNamespace ?? null),
|
|
1916
|
+
backupPending: (0, import_vue26.computed)(() => (0, import_vue26.toValue)(options.backupPending)),
|
|
1917
|
+
storageSecurityLevel: (0, import_vue26.computed)(() => (0, import_vue26.toValue)(options.storageSecurityLevel)),
|
|
1918
|
+
securityReport: (0, import_vue26.computed)(() => (0, import_vue26.toValue)(options.securityReport)),
|
|
1919
|
+
connectEmbedded: () => run(() => (0, import_vue26.unref)(options.connectEmbedded)()),
|
|
1920
|
+
restoreWallet: () => run(() => (0, import_vue26.unref)(options.restoreWallet)()),
|
|
1921
|
+
generateWallet: () => run(() => (0, import_vue26.unref)(options.generateWallet)()),
|
|
1922
|
+
importFromMnemonic: (value) => run(() => (0, import_vue26.unref)(options.importFromMnemonic)(value)),
|
|
1923
|
+
importFromPrivateKey: (value) => run(() => (0, import_vue26.unref)(options.importFromPrivateKey)(value)),
|
|
1924
|
+
wipe: () => run(() => (0, import_vue26.unref)(options.wipe)()),
|
|
1925
|
+
setActiveNamespace: (value) => (0, import_vue26.unref)(options.setActiveNamespace)(value),
|
|
1926
|
+
backfillAccounts: () => run(() => (0, import_vue26.unref)(options.backfillAccounts)()),
|
|
1927
|
+
getSeedPhrase: () => (0, import_vue26.unref)(options.getSeedPhrase)(),
|
|
1928
|
+
getPrivateKey: () => (0, import_vue26.unref)(options.getPrivateKey)(),
|
|
1929
|
+
confirmBackup: () => (0, import_vue26.unref)(options.confirmBackup)(),
|
|
1867
1930
|
isBusy: guard.busy,
|
|
1868
1931
|
error: guard.error,
|
|
1869
1932
|
clearError: guard.clearError
|
|
@@ -1882,43 +1945,43 @@ function useSIWxLogin(action) {
|
|
|
1882
1945
|
}
|
|
1883
1946
|
|
|
1884
1947
|
// src/useSIWxSession.ts
|
|
1885
|
-
var
|
|
1948
|
+
var import_vue27 = require("vue");
|
|
1886
1949
|
function useSIWxSession(options) {
|
|
1887
1950
|
const guard = useActionGuard();
|
|
1888
1951
|
return {
|
|
1889
|
-
session: (0,
|
|
1890
|
-
isAuthenticated: (0,
|
|
1891
|
-
() => (0,
|
|
1952
|
+
session: (0, import_vue27.computed)(() => (0, import_vue27.toValue)(options.session)),
|
|
1953
|
+
isAuthenticated: (0, import_vue27.computed)(
|
|
1954
|
+
() => (0, import_vue27.toValue)(options.session) !== null && !(0, import_vue27.toValue)(options.isExpired)
|
|
1892
1955
|
),
|
|
1893
|
-
isRestoring: (0,
|
|
1956
|
+
isRestoring: (0, import_vue27.computed)(() => (0, import_vue27.toValue)(options.isRestoring)),
|
|
1894
1957
|
isSigningIn: guard.busy,
|
|
1895
|
-
isExpired: (0,
|
|
1896
|
-
timeUntilExpiry: (0,
|
|
1897
|
-
signIn: (input) => guard.run(() => (0,
|
|
1958
|
+
isExpired: (0, import_vue27.computed)(() => (0, import_vue27.toValue)(options.isExpired)),
|
|
1959
|
+
timeUntilExpiry: (0, import_vue27.computed)(() => (0, import_vue27.toValue)(options.timeUntilExpiry)),
|
|
1960
|
+
signIn: (input) => guard.run(() => (0, import_vue27.unref)(options.signIn)(input), "SIWX sign-in failed"),
|
|
1898
1961
|
signOut: async () => {
|
|
1899
|
-
await (0,
|
|
1962
|
+
await (0, import_vue27.unref)(options.signOut)();
|
|
1900
1963
|
guard.clearError();
|
|
1901
1964
|
},
|
|
1902
|
-
refresh: () => guard.run(() => (0,
|
|
1965
|
+
refresh: () => guard.run(() => (0, import_vue27.unref)(options.refresh)(), "Session refresh failed"),
|
|
1903
1966
|
error: guard.error,
|
|
1904
1967
|
clearError: guard.clearError
|
|
1905
1968
|
};
|
|
1906
1969
|
}
|
|
1907
1970
|
|
|
1908
1971
|
// src/useSiwxAuthSession.ts
|
|
1909
|
-
var
|
|
1972
|
+
var import_vue28 = require("vue");
|
|
1910
1973
|
function useSiwxAuthSession(options) {
|
|
1911
1974
|
const guard = useActionGuard();
|
|
1912
|
-
const signIn = (input) => guard.run(() => (0,
|
|
1975
|
+
const signIn = (input) => guard.run(() => (0, import_vue28.unref)(options.signIn)(input), "SIWX sign-in failed");
|
|
1913
1976
|
const signOut = async () => {
|
|
1914
1977
|
guard.reset();
|
|
1915
|
-
await (0,
|
|
1978
|
+
await (0, import_vue28.unref)(options.signOut)();
|
|
1916
1979
|
guard.clearError();
|
|
1917
1980
|
};
|
|
1918
|
-
const siwxResult = (0,
|
|
1981
|
+
const siwxResult = (0, import_vue28.computed)(() => (0, import_vue28.toValue)(options.result));
|
|
1919
1982
|
return {
|
|
1920
|
-
isSignedIn: (0,
|
|
1921
|
-
isRestoring: (0,
|
|
1983
|
+
isSignedIn: (0, import_vue28.computed)(() => siwxResult.value !== null),
|
|
1984
|
+
isRestoring: (0, import_vue28.computed)(() => (0, import_vue28.toValue)(options.isRestoring)),
|
|
1922
1985
|
siwxResult,
|
|
1923
1986
|
isSigningIn: guard.busy,
|
|
1924
1987
|
error: guard.error,
|
|
@@ -1930,16 +1993,16 @@ function useSiwxAuthSession(options) {
|
|
|
1930
1993
|
|
|
1931
1994
|
// src/useBalance.ts
|
|
1932
1995
|
var import_connect_appkit_core14 = require("@naculus/connect-appkit-core");
|
|
1933
|
-
var
|
|
1934
|
-
var
|
|
1996
|
+
var import_connect_core12 = require("@naculus/connect-core");
|
|
1997
|
+
var import_vue29 = require("vue");
|
|
1935
1998
|
function useBalance(account, client, options = {}) {
|
|
1936
1999
|
const guard = useActionGuard();
|
|
1937
|
-
const balance = (0,
|
|
1938
|
-
const isFetching = (0,
|
|
2000
|
+
const balance = (0, import_vue29.shallowRef)(null);
|
|
2001
|
+
const isFetching = (0, import_vue29.shallowRef)(false);
|
|
1939
2002
|
let timer = null;
|
|
1940
2003
|
const refetch = async () => {
|
|
1941
|
-
const reader = (0,
|
|
1942
|
-
const address = (0, import_connect_appkit_core14.bareEvmAddress)((0,
|
|
2004
|
+
const reader = (0, import_vue29.toValue)(client);
|
|
2005
|
+
const address = (0, import_connect_appkit_core14.bareEvmAddress)((0, import_vue29.toValue)(account));
|
|
1943
2006
|
if (!reader || !address) {
|
|
1944
2007
|
guard.reset();
|
|
1945
2008
|
balance.value = null;
|
|
@@ -1975,11 +2038,11 @@ function useBalance(account, client, options = {}) {
|
|
|
1975
2038
|
if (timer) clearInterval(timer);
|
|
1976
2039
|
timer = null;
|
|
1977
2040
|
};
|
|
1978
|
-
(0,
|
|
2041
|
+
(0, import_vue29.watch)(
|
|
1979
2042
|
[
|
|
1980
|
-
() => (0,
|
|
1981
|
-
() => (0,
|
|
1982
|
-
() => (0,
|
|
2043
|
+
() => (0, import_vue29.toValue)(account),
|
|
2044
|
+
() => (0, import_vue29.toValue)(client),
|
|
2045
|
+
() => (0, import_vue29.toValue)(options.refreshInterval) ?? 0
|
|
1983
2046
|
],
|
|
1984
2047
|
([, , interval]) => {
|
|
1985
2048
|
stopTimer();
|
|
@@ -1988,13 +2051,13 @@ function useBalance(account, client, options = {}) {
|
|
|
1988
2051
|
},
|
|
1989
2052
|
{ immediate: true }
|
|
1990
2053
|
);
|
|
1991
|
-
(0,
|
|
2054
|
+
(0, import_vue29.onScopeDispose)(stopTimer);
|
|
1992
2055
|
return {
|
|
1993
2056
|
balance,
|
|
1994
|
-
formatted: (0,
|
|
1995
|
-
() => balance.value === null ? null : (0,
|
|
2057
|
+
formatted: (0, import_vue29.computed)(
|
|
2058
|
+
() => balance.value === null ? null : (0, import_connect_core12.formatUnits)(BigInt(balance.value), (0, import_vue29.toValue)(options.decimals) ?? 18)
|
|
1996
2059
|
),
|
|
1997
|
-
symbol: (0,
|
|
2060
|
+
symbol: (0, import_vue29.computed)(() => (0, import_vue29.toValue)(options.symbol) ?? null),
|
|
1998
2061
|
isFetching,
|
|
1999
2062
|
error: guard.error,
|
|
2000
2063
|
refetch
|
|
@@ -2003,11 +2066,11 @@ function useBalance(account, client, options = {}) {
|
|
|
2003
2066
|
|
|
2004
2067
|
// src/useRouteQuote.ts
|
|
2005
2068
|
var import_connect_appkit_core15 = require("@naculus/connect-appkit-core");
|
|
2006
|
-
var
|
|
2069
|
+
var import_vue30 = require("vue");
|
|
2007
2070
|
function useRouteQuote(input, getQuotes, options = {}) {
|
|
2008
2071
|
const guard = useActionGuard();
|
|
2009
|
-
const quotes = (0,
|
|
2010
|
-
const loading = (0,
|
|
2072
|
+
const quotes = (0, import_vue30.shallowRef)([]);
|
|
2073
|
+
const loading = (0, import_vue30.shallowRef)(false);
|
|
2011
2074
|
let timer = null;
|
|
2012
2075
|
const clearTimer = () => {
|
|
2013
2076
|
if (timer) clearTimeout(timer);
|
|
@@ -2020,7 +2083,7 @@ function useRouteQuote(input, getQuotes, options = {}) {
|
|
|
2020
2083
|
quotes.value = [];
|
|
2021
2084
|
return null;
|
|
2022
2085
|
}
|
|
2023
|
-
const fn = (0,
|
|
2086
|
+
const fn = (0, import_vue30.unref)(getQuotes);
|
|
2024
2087
|
if (!fn) {
|
|
2025
2088
|
guard.invalidate();
|
|
2026
2089
|
loading.value = false;
|
|
@@ -2029,7 +2092,7 @@ function useRouteQuote(input, getQuotes, options = {}) {
|
|
|
2029
2092
|
return fn;
|
|
2030
2093
|
};
|
|
2031
2094
|
const fetchQuotes = async () => {
|
|
2032
|
-
const current = (0,
|
|
2095
|
+
const current = (0, import_vue30.toValue)(input);
|
|
2033
2096
|
const fn = requestable(current);
|
|
2034
2097
|
if (!fn) return;
|
|
2035
2098
|
loading.value = true;
|
|
@@ -2064,19 +2127,19 @@ function useRouteQuote(input, getQuotes, options = {}) {
|
|
|
2064
2127
|
).catch(() => {
|
|
2065
2128
|
});
|
|
2066
2129
|
};
|
|
2067
|
-
(0,
|
|
2130
|
+
(0, import_vue30.watch)(
|
|
2068
2131
|
[
|
|
2069
|
-
() => (0,
|
|
2070
|
-
() => (0,
|
|
2071
|
-
() => (0,
|
|
2072
|
-
() => (0,
|
|
2073
|
-
() => (0,
|
|
2074
|
-
() => (0,
|
|
2132
|
+
() => (0, import_vue30.toValue)(input).fromChain,
|
|
2133
|
+
() => (0, import_vue30.toValue)(input).toChain,
|
|
2134
|
+
() => (0, import_vue30.toValue)(input).fromToken,
|
|
2135
|
+
() => (0, import_vue30.toValue)(input).toToken,
|
|
2136
|
+
() => (0, import_vue30.toValue)(input).amount,
|
|
2137
|
+
() => (0, import_vue30.unref)(getQuotes)
|
|
2075
2138
|
],
|
|
2076
2139
|
() => {
|
|
2077
2140
|
clearTimer();
|
|
2078
2141
|
guard.invalidate();
|
|
2079
|
-
if (!requestable((0,
|
|
2142
|
+
if (!requestable((0, import_vue30.toValue)(input))) return;
|
|
2080
2143
|
timer = setTimeout(() => {
|
|
2081
2144
|
timer = null;
|
|
2082
2145
|
void fetchQuotes();
|
|
@@ -2084,7 +2147,7 @@ function useRouteQuote(input, getQuotes, options = {}) {
|
|
|
2084
2147
|
},
|
|
2085
2148
|
{ immediate: true }
|
|
2086
2149
|
);
|
|
2087
|
-
(0,
|
|
2150
|
+
(0, import_vue30.onScopeDispose)(clearTimer);
|
|
2088
2151
|
return {
|
|
2089
2152
|
quotes,
|
|
2090
2153
|
loading,
|
|
@@ -2101,14 +2164,14 @@ function useRouteQuote(input, getQuotes, options = {}) {
|
|
|
2101
2164
|
|
|
2102
2165
|
// src/useCompareCosts.ts
|
|
2103
2166
|
var import_connect_appkit_core16 = require("@naculus/connect-appkit-core");
|
|
2104
|
-
var
|
|
2167
|
+
var import_vue31 = require("vue");
|
|
2105
2168
|
function useCompareCosts(input, compareCosts) {
|
|
2106
2169
|
const guard = useActionGuard();
|
|
2107
|
-
const comparisons = (0,
|
|
2108
|
-
const loading = (0,
|
|
2170
|
+
const comparisons = (0, import_vue31.shallowRef)([]);
|
|
2171
|
+
const loading = (0, import_vue31.shallowRef)(false);
|
|
2109
2172
|
const fetchComparisons = async () => {
|
|
2110
|
-
const { operation, chains, options } = (0,
|
|
2111
|
-
const fn = (0,
|
|
2173
|
+
const { operation, chains, options } = (0, import_vue31.toValue)(input);
|
|
2174
|
+
const fn = (0, import_vue31.unref)(compareCosts);
|
|
2112
2175
|
if (!chains || chains.length === 0) {
|
|
2113
2176
|
guard.invalidate();
|
|
2114
2177
|
loading.value = false;
|
|
@@ -2145,8 +2208,8 @@ function useCompareCosts(input, compareCosts) {
|
|
|
2145
2208
|
).catch(() => {
|
|
2146
2209
|
});
|
|
2147
2210
|
};
|
|
2148
|
-
(0,
|
|
2149
|
-
[() => (0, import_connect_appkit_core16.compareCostsKey)((0,
|
|
2211
|
+
(0, import_vue31.watch)(
|
|
2212
|
+
[() => (0, import_connect_appkit_core16.compareCostsKey)((0, import_vue31.toValue)(input)), () => (0, import_vue31.unref)(compareCosts)],
|
|
2150
2213
|
() => {
|
|
2151
2214
|
void fetchComparisons();
|
|
2152
2215
|
},
|
|
@@ -2162,15 +2225,15 @@ function useCompareCosts(input, compareCosts) {
|
|
|
2162
2225
|
|
|
2163
2226
|
// src/useExecuteRoute.ts
|
|
2164
2227
|
var import_connect_appkit_core17 = require("@naculus/connect-appkit-core");
|
|
2165
|
-
var
|
|
2228
|
+
var import_vue32 = require("vue");
|
|
2166
2229
|
function useExecuteRoute(executeRoute) {
|
|
2167
|
-
const executing = (0,
|
|
2168
|
-
const result = (0,
|
|
2169
|
-
const error = (0,
|
|
2230
|
+
const executing = (0, import_vue32.shallowRef)(false);
|
|
2231
|
+
const result = (0, import_vue32.shallowRef)(null);
|
|
2232
|
+
const error = (0, import_vue32.shallowRef)(null);
|
|
2170
2233
|
let inFlight = false;
|
|
2171
2234
|
let disposed = false;
|
|
2172
2235
|
const execute = async (quote, recipient, options) => {
|
|
2173
|
-
const fn = (0,
|
|
2236
|
+
const fn = (0, import_vue32.unref)(executeRoute);
|
|
2174
2237
|
if (!fn) {
|
|
2175
2238
|
error.value = {
|
|
2176
2239
|
code: "no_executor",
|
|
@@ -2208,7 +2271,7 @@ function useExecuteRoute(executeRoute) {
|
|
|
2208
2271
|
if (!disposed) executing.value = false;
|
|
2209
2272
|
}
|
|
2210
2273
|
};
|
|
2211
|
-
(0,
|
|
2274
|
+
(0, import_vue32.onScopeDispose)(() => {
|
|
2212
2275
|
disposed = true;
|
|
2213
2276
|
});
|
|
2214
2277
|
return {
|
|
@@ -2226,18 +2289,18 @@ function useExecuteRoute(executeRoute) {
|
|
|
2226
2289
|
|
|
2227
2290
|
// src/useTokenList.ts
|
|
2228
2291
|
var import_connect_appkit_core18 = require("@naculus/connect-appkit-core");
|
|
2229
|
-
var
|
|
2230
|
-
var
|
|
2292
|
+
var import_connect_core13 = require("@naculus/connect-core");
|
|
2293
|
+
var import_vue33 = require("vue");
|
|
2231
2294
|
function useTokenList(chainId, options = {}) {
|
|
2232
2295
|
const config = {};
|
|
2233
2296
|
if (options.sources) config.sources = options.sources;
|
|
2234
|
-
const manager = options.manager ?? new
|
|
2297
|
+
const manager = options.manager ?? new import_connect_core13.TokenListManager(config);
|
|
2235
2298
|
const guard = useActionGuard();
|
|
2236
|
-
const tokens = (0,
|
|
2237
|
-
const isLoading = (0,
|
|
2238
|
-
const isLoaded = (0,
|
|
2299
|
+
const tokens = (0, import_vue33.shallowRef)([]);
|
|
2300
|
+
const isLoading = (0, import_vue33.shallowRef)(options.autoLoad !== false);
|
|
2301
|
+
const isLoaded = (0, import_vue33.shallowRef)(false);
|
|
2239
2302
|
const select = () => {
|
|
2240
|
-
const id = (0,
|
|
2303
|
+
const id = (0, import_vue33.toValue)(chainId);
|
|
2241
2304
|
const numeric = id ? (0, import_connect_appkit_core18.eip155ChainIdToNumber)(id) : void 0;
|
|
2242
2305
|
return manager.getTokens(
|
|
2243
2306
|
numeric !== void 0 ? { chainId: numeric } : void 0
|
|
@@ -2263,8 +2326,8 @@ function useTokenList(chainId, options = {}) {
|
|
|
2263
2326
|
).catch(() => {
|
|
2264
2327
|
});
|
|
2265
2328
|
};
|
|
2266
|
-
(0,
|
|
2267
|
-
() => (0,
|
|
2329
|
+
(0, import_vue33.watch)(
|
|
2330
|
+
() => (0, import_vue33.toValue)(chainId),
|
|
2268
2331
|
() => {
|
|
2269
2332
|
if (options.autoLoad !== false) void run(() => manager.load());
|
|
2270
2333
|
},
|
|
@@ -2281,29 +2344,29 @@ function useTokenList(chainId, options = {}) {
|
|
|
2281
2344
|
|
|
2282
2345
|
// src/useTokenSearch.ts
|
|
2283
2346
|
var import_connect_appkit_core19 = require("@naculus/connect-appkit-core");
|
|
2284
|
-
var
|
|
2285
|
-
var
|
|
2347
|
+
var import_connect_core14 = require("@naculus/connect-core");
|
|
2348
|
+
var import_vue34 = require("vue");
|
|
2286
2349
|
var DEBOUNCE_MS = 300;
|
|
2287
2350
|
var EMPTY = { exact: [], fuzzy: [], hasMore: false };
|
|
2288
2351
|
var sharedManager = null;
|
|
2289
2352
|
function getSharedManager() {
|
|
2290
2353
|
if (!sharedManager) {
|
|
2291
|
-
sharedManager = new
|
|
2354
|
+
sharedManager = new import_connect_core14.TokenListManager();
|
|
2292
2355
|
sharedManager.load().catch(() => {
|
|
2293
2356
|
});
|
|
2294
2357
|
}
|
|
2295
2358
|
return sharedManager;
|
|
2296
2359
|
}
|
|
2297
2360
|
function useTokenSearch(query, chainId, options = {}) {
|
|
2298
|
-
const results = (0,
|
|
2299
|
-
const isSearching = (0,
|
|
2361
|
+
const results = (0, import_vue34.shallowRef)(EMPTY);
|
|
2362
|
+
const isSearching = (0, import_vue34.shallowRef)(false);
|
|
2300
2363
|
let timer = null;
|
|
2301
2364
|
const clear = () => {
|
|
2302
2365
|
if (timer) clearTimeout(timer);
|
|
2303
2366
|
timer = null;
|
|
2304
2367
|
};
|
|
2305
|
-
(0,
|
|
2306
|
-
[() => ((0,
|
|
2368
|
+
(0, import_vue34.watch)(
|
|
2369
|
+
[() => ((0, import_vue34.toValue)(query) ?? "").trim(), () => (0, import_vue34.toValue)(chainId)],
|
|
2307
2370
|
([q, id]) => {
|
|
2308
2371
|
clear();
|
|
2309
2372
|
if (!q) {
|
|
@@ -2325,35 +2388,35 @@ function useTokenSearch(query, chainId, options = {}) {
|
|
|
2325
2388
|
},
|
|
2326
2389
|
{ immediate: true }
|
|
2327
2390
|
);
|
|
2328
|
-
(0,
|
|
2391
|
+
(0, import_vue34.onScopeDispose)(clear);
|
|
2329
2392
|
return { results, isSearching };
|
|
2330
2393
|
}
|
|
2331
2394
|
|
|
2332
2395
|
// src/useValidateDestination.ts
|
|
2333
2396
|
var import_connect_appkit_core20 = require("@naculus/connect-appkit-core");
|
|
2334
|
-
var
|
|
2397
|
+
var import_vue35 = require("vue");
|
|
2335
2398
|
function useValidateDestination(address) {
|
|
2336
2399
|
return {
|
|
2337
|
-
validation: (0,
|
|
2400
|
+
validation: (0, import_vue35.computed)(() => (0, import_connect_appkit_core20.validateDestination)((0, import_vue35.toValue)(address) ?? ""))
|
|
2338
2401
|
};
|
|
2339
2402
|
}
|
|
2340
2403
|
|
|
2341
2404
|
// src/useTokenBalance.ts
|
|
2342
2405
|
var import_connect_appkit_core21 = require("@naculus/connect-appkit-core");
|
|
2343
|
-
var
|
|
2344
|
-
var
|
|
2406
|
+
var import_connect_core15 = require("@naculus/connect-core");
|
|
2407
|
+
var import_vue36 = require("vue");
|
|
2345
2408
|
function tokensKey(tokens) {
|
|
2346
2409
|
return tokens.map((t) => `${t.address.toLowerCase()}|${t.decimals}|${t.symbol}`).join(",");
|
|
2347
2410
|
}
|
|
2348
2411
|
function useTokenBalance(account, client, tokens, options = {}) {
|
|
2349
2412
|
const guard = useActionGuard();
|
|
2350
|
-
const tokenBalances = (0,
|
|
2351
|
-
const isFetching = (0,
|
|
2413
|
+
const tokenBalances = (0, import_vue36.shallowRef)([]);
|
|
2414
|
+
const isFetching = (0, import_vue36.shallowRef)(false);
|
|
2352
2415
|
let timer = null;
|
|
2353
2416
|
const refetch = async () => {
|
|
2354
|
-
const reader = (0,
|
|
2355
|
-
const address = (0, import_connect_appkit_core21.bareEvmAddress)((0,
|
|
2356
|
-
const list = (0,
|
|
2417
|
+
const reader = (0, import_vue36.toValue)(client);
|
|
2418
|
+
const address = (0, import_connect_appkit_core21.bareEvmAddress)((0, import_vue36.toValue)(account));
|
|
2419
|
+
const list = (0, import_vue36.toValue)(tokens) ?? [];
|
|
2357
2420
|
if (!reader || !address || list.length === 0) {
|
|
2358
2421
|
guard.reset();
|
|
2359
2422
|
tokenBalances.value = [];
|
|
@@ -2369,7 +2432,7 @@ function useTokenBalance(account, client, tokens, options = {}) {
|
|
|
2369
2432
|
try {
|
|
2370
2433
|
const raw = await reader.readContract({
|
|
2371
2434
|
address: token.address,
|
|
2372
|
-
abi:
|
|
2435
|
+
abi: import_connect_core15.ERC20_MIN_ABI,
|
|
2373
2436
|
functionName: "balanceOf",
|
|
2374
2437
|
args: [address]
|
|
2375
2438
|
});
|
|
@@ -2377,7 +2440,7 @@ function useTokenBalance(account, client, tokens, options = {}) {
|
|
|
2377
2440
|
return {
|
|
2378
2441
|
...token,
|
|
2379
2442
|
balance: value.toString(),
|
|
2380
|
-
formatted: (0,
|
|
2443
|
+
formatted: (0, import_connect_core15.formatUnits)(value, token.decimals)
|
|
2381
2444
|
};
|
|
2382
2445
|
} catch {
|
|
2383
2446
|
return { ...token, balance: null, formatted: null };
|
|
@@ -2408,12 +2471,12 @@ function useTokenBalance(account, client, tokens, options = {}) {
|
|
|
2408
2471
|
if (timer) clearInterval(timer);
|
|
2409
2472
|
timer = null;
|
|
2410
2473
|
};
|
|
2411
|
-
(0,
|
|
2474
|
+
(0, import_vue36.watch)(
|
|
2412
2475
|
[
|
|
2413
|
-
() => (0,
|
|
2414
|
-
() => (0,
|
|
2415
|
-
() => tokensKey((0,
|
|
2416
|
-
() => (0,
|
|
2476
|
+
() => (0, import_vue36.toValue)(account),
|
|
2477
|
+
() => (0, import_vue36.toValue)(client),
|
|
2478
|
+
() => tokensKey((0, import_vue36.toValue)(tokens) ?? []),
|
|
2479
|
+
() => (0, import_vue36.toValue)(options.refreshInterval) ?? 0
|
|
2417
2480
|
],
|
|
2418
2481
|
([, , , interval]) => {
|
|
2419
2482
|
stopTimer();
|
|
@@ -2422,7 +2485,7 @@ function useTokenBalance(account, client, tokens, options = {}) {
|
|
|
2422
2485
|
},
|
|
2423
2486
|
{ immediate: true }
|
|
2424
2487
|
);
|
|
2425
|
-
(0,
|
|
2488
|
+
(0, import_vue36.onScopeDispose)(stopTimer);
|
|
2426
2489
|
return {
|
|
2427
2490
|
tokenBalances,
|
|
2428
2491
|
isFetching,
|
|
@@ -2436,12 +2499,12 @@ function useTokenBalance(account, client, tokens, options = {}) {
|
|
|
2436
2499
|
|
|
2437
2500
|
// src/useDelegate.ts
|
|
2438
2501
|
var import_connect_appkit_core22 = require("@naculus/connect-appkit-core");
|
|
2439
|
-
var
|
|
2440
|
-
var
|
|
2502
|
+
var import_connect_core16 = require("@naculus/connect-core");
|
|
2503
|
+
var import_vue37 = require("vue");
|
|
2441
2504
|
function useDelegate(options) {
|
|
2442
|
-
const result = (0,
|
|
2443
|
-
const isPending = (0,
|
|
2444
|
-
const error = (0,
|
|
2505
|
+
const result = (0, import_vue37.shallowRef)(null);
|
|
2506
|
+
const isPending = (0, import_vue37.shallowRef)(false);
|
|
2507
|
+
const error = (0, import_vue37.shallowRef)(null);
|
|
2445
2508
|
let requestId = 0;
|
|
2446
2509
|
let inFlight = false;
|
|
2447
2510
|
let disposed = false;
|
|
@@ -2451,31 +2514,31 @@ function useDelegate(options) {
|
|
|
2451
2514
|
};
|
|
2452
2515
|
const run = async (target, allowlist) => {
|
|
2453
2516
|
if (inFlight) return fail(new Error("A delegation is already in progress"));
|
|
2454
|
-
const session = (0,
|
|
2455
|
-
const account = (0, import_connect_appkit_core22.bareEvmAddress)((0,
|
|
2456
|
-
const chainId = (0,
|
|
2517
|
+
const session = (0, import_vue37.toValue)(options.session);
|
|
2518
|
+
const account = (0, import_connect_appkit_core22.bareEvmAddress)((0, import_vue37.toValue)(options.account));
|
|
2519
|
+
const chainId = (0, import_vue37.toValue)(options.chainId);
|
|
2457
2520
|
if (!session || !account || !chainId) {
|
|
2458
2521
|
return fail(
|
|
2459
|
-
new
|
|
2522
|
+
new import_connect_core16.WalletError("wallet_unavailable", "No connected EVM account")
|
|
2460
2523
|
);
|
|
2461
2524
|
}
|
|
2462
|
-
const reader = (0,
|
|
2463
|
-
if (!reader || reader.chain?.id !== (0,
|
|
2525
|
+
const reader = (0, import_vue37.toValue)(options.client);
|
|
2526
|
+
if (!reader || reader.chain?.id !== (0, import_connect_core16.eip155Reference)(chainId)) {
|
|
2464
2527
|
return fail(
|
|
2465
|
-
new
|
|
2528
|
+
new import_connect_core16.WalletError(
|
|
2466
2529
|
"chain_mismatch",
|
|
2467
2530
|
`No RPC client for ${chainId}; refusing to read the nonce elsewhere.`
|
|
2468
2531
|
)
|
|
2469
2532
|
);
|
|
2470
2533
|
}
|
|
2471
|
-
const connector = (0,
|
|
2534
|
+
const connector = (0, import_vue37.toValue)(options.connector) ?? {};
|
|
2472
2535
|
const own = ++requestId;
|
|
2473
2536
|
inFlight = true;
|
|
2474
2537
|
isPending.value = true;
|
|
2475
2538
|
error.value = null;
|
|
2476
2539
|
result.value = null;
|
|
2477
2540
|
try {
|
|
2478
|
-
const sent = await (0,
|
|
2541
|
+
const sent = await (0, import_connect_core16.delegateAccount)({
|
|
2479
2542
|
connector,
|
|
2480
2543
|
session,
|
|
2481
2544
|
account,
|
|
@@ -2503,22 +2566,22 @@ function useDelegate(options) {
|
|
|
2503
2566
|
isPending.value = false;
|
|
2504
2567
|
error.value = null;
|
|
2505
2568
|
};
|
|
2506
|
-
(0,
|
|
2569
|
+
(0, import_vue37.watch)(
|
|
2507
2570
|
[
|
|
2508
|
-
() => (0,
|
|
2509
|
-
() => (0,
|
|
2510
|
-
() => (0,
|
|
2571
|
+
() => (0, import_vue37.toValue)(options.session),
|
|
2572
|
+
() => (0, import_vue37.toValue)(options.account),
|
|
2573
|
+
() => (0, import_vue37.toValue)(options.chainId)
|
|
2511
2574
|
],
|
|
2512
2575
|
reset,
|
|
2513
2576
|
{ flush: "sync" }
|
|
2514
2577
|
);
|
|
2515
|
-
(0,
|
|
2578
|
+
(0, import_vue37.onScopeDispose)(() => {
|
|
2516
2579
|
disposed = true;
|
|
2517
2580
|
requestId++;
|
|
2518
2581
|
});
|
|
2519
2582
|
return {
|
|
2520
|
-
delegate: (target) => run(target, (0,
|
|
2521
|
-
revoke: () => run(
|
|
2583
|
+
delegate: (target) => run(target, (0, import_vue37.toValue)(options.allowlist)),
|
|
2584
|
+
revoke: () => run(import_connect_core16.REVOKE_DELEGATE, []),
|
|
2522
2585
|
result,
|
|
2523
2586
|
isPending,
|
|
2524
2587
|
error,
|
|
@@ -2528,16 +2591,16 @@ function useDelegate(options) {
|
|
|
2528
2591
|
|
|
2529
2592
|
// src/useDelegation.ts
|
|
2530
2593
|
var import_connect_appkit_core23 = require("@naculus/connect-appkit-core");
|
|
2531
|
-
var
|
|
2532
|
-
var
|
|
2594
|
+
var import_connect_core17 = require("@naculus/connect-core");
|
|
2595
|
+
var import_vue38 = require("vue");
|
|
2533
2596
|
function useDelegation(account, client, chainId) {
|
|
2534
2597
|
const guard = useActionGuard();
|
|
2535
|
-
const status = (0,
|
|
2536
|
-
const isFetching = (0,
|
|
2598
|
+
const status = (0, import_vue38.shallowRef)(import_connect_core17.UNKNOWN_DELEGATION);
|
|
2599
|
+
const isFetching = (0, import_vue38.shallowRef)(false);
|
|
2537
2600
|
const refetch = async () => {
|
|
2538
|
-
const reader = (0,
|
|
2539
|
-
const address = (0, import_connect_appkit_core23.bareEvmAddress)((0,
|
|
2540
|
-
status.value =
|
|
2601
|
+
const reader = (0, import_vue38.toValue)(client);
|
|
2602
|
+
const address = (0, import_connect_appkit_core23.bareEvmAddress)((0, import_vue38.toValue)(account));
|
|
2603
|
+
status.value = import_connect_core17.UNKNOWN_DELEGATION;
|
|
2541
2604
|
if (!reader || !address) {
|
|
2542
2605
|
guard.reset();
|
|
2543
2606
|
isFetching.value = false;
|
|
@@ -2549,11 +2612,11 @@ function useDelegation(account, client, chainId) {
|
|
|
2549
2612
|
try {
|
|
2550
2613
|
const code = await reader.getCode({ address });
|
|
2551
2614
|
commit(() => {
|
|
2552
|
-
status.value = (0,
|
|
2615
|
+
status.value = (0, import_connect_core17.readDelegation)(code ?? "0x");
|
|
2553
2616
|
});
|
|
2554
2617
|
} catch (cause) {
|
|
2555
2618
|
commit(() => {
|
|
2556
|
-
status.value =
|
|
2619
|
+
status.value = import_connect_core17.UNKNOWN_DELEGATION;
|
|
2557
2620
|
});
|
|
2558
2621
|
throw cause;
|
|
2559
2622
|
}
|
|
@@ -2568,16 +2631,16 @@ function useDelegation(account, client, chainId) {
|
|
|
2568
2631
|
).catch(() => {
|
|
2569
2632
|
});
|
|
2570
2633
|
};
|
|
2571
|
-
(0,
|
|
2572
|
-
[() => (0,
|
|
2634
|
+
(0, import_vue38.watch)(
|
|
2635
|
+
[() => (0, import_vue38.toValue)(account), () => (0, import_vue38.toValue)(client), () => (0, import_vue38.toValue)(chainId)],
|
|
2573
2636
|
() => {
|
|
2574
2637
|
void refetch();
|
|
2575
2638
|
},
|
|
2576
2639
|
{ immediate: true, flush: "sync" }
|
|
2577
2640
|
);
|
|
2578
2641
|
return {
|
|
2579
|
-
delegated: (0,
|
|
2580
|
-
delegate: (0,
|
|
2642
|
+
delegated: (0, import_vue38.computed)(() => status.value.delegated),
|
|
2643
|
+
delegate: (0, import_vue38.computed)(() => status.value.delegate),
|
|
2581
2644
|
isFetching,
|
|
2582
2645
|
error: guard.error,
|
|
2583
2646
|
refetch
|
|
@@ -2586,21 +2649,61 @@ function useDelegation(account, client, chainId) {
|
|
|
2586
2649
|
|
|
2587
2650
|
// src/usePaymentFetch.ts
|
|
2588
2651
|
var import_connect_appkit_core24 = require("@naculus/connect-appkit-core");
|
|
2589
|
-
var
|
|
2590
|
-
function usePaymentFetch(pay) {
|
|
2652
|
+
var import_vue39 = require("vue");
|
|
2653
|
+
function usePaymentFetch(pay, options = {}) {
|
|
2591
2654
|
const guard = useActionGuard();
|
|
2592
|
-
const lastPayment = (0,
|
|
2655
|
+
const lastPayment = (0, import_vue39.shallowRef)(null);
|
|
2593
2656
|
let epoch = 0;
|
|
2594
|
-
|
|
2657
|
+
let verification = 0;
|
|
2658
|
+
(0, import_vue39.onScopeDispose)(() => {
|
|
2595
2659
|
epoch++;
|
|
2660
|
+
verification++;
|
|
2596
2661
|
});
|
|
2597
2662
|
const payFetch = (input, init) => {
|
|
2598
|
-
const invoke = (0,
|
|
2663
|
+
const invoke = (0, import_vue39.unref)(pay);
|
|
2599
2664
|
const own = epoch;
|
|
2600
2665
|
return guard.run(async () => {
|
|
2601
2666
|
const result = await invoke(input, init);
|
|
2602
|
-
|
|
2603
|
-
if (payment && own === epoch)
|
|
2667
|
+
let payment = (0, import_connect_appkit_core24.describePayment)(input, result);
|
|
2668
|
+
if (payment && own === epoch) {
|
|
2669
|
+
const verify = options.verify;
|
|
2670
|
+
if (!verify) {
|
|
2671
|
+
lastPayment.value = payment;
|
|
2672
|
+
} else {
|
|
2673
|
+
payment = (0, import_connect_appkit_core24.applySettlementVerification)(payment, { status: "pending" });
|
|
2674
|
+
lastPayment.value = payment;
|
|
2675
|
+
const verificationOwn = ++verification;
|
|
2676
|
+
const retry = options.verifyRetry ?? import_connect_appkit_core24.DEFAULT_VERIFY_RETRY;
|
|
2677
|
+
void Promise.resolve().then(async () => {
|
|
2678
|
+
let outcome = { status: "pending" };
|
|
2679
|
+
for (let attempt = 0; attempt < retry.attempts; attempt += 1) {
|
|
2680
|
+
if (attempt > 0) {
|
|
2681
|
+
await new Promise(
|
|
2682
|
+
(resolve) => setTimeout(resolve, retry.delayMs)
|
|
2683
|
+
);
|
|
2684
|
+
}
|
|
2685
|
+
if (own !== epoch || verificationOwn !== verification) return;
|
|
2686
|
+
try {
|
|
2687
|
+
outcome = await verify(result);
|
|
2688
|
+
} catch (cause) {
|
|
2689
|
+
outcome = {
|
|
2690
|
+
status: "unavailable",
|
|
2691
|
+
reason: cause instanceof Error ? cause.message : "Settlement verification failed"
|
|
2692
|
+
};
|
|
2693
|
+
}
|
|
2694
|
+
if (outcome.status !== "pending") break;
|
|
2695
|
+
}
|
|
2696
|
+
if (own === epoch && verificationOwn === verification) {
|
|
2697
|
+
const current = lastPayment.value;
|
|
2698
|
+
if (current)
|
|
2699
|
+
lastPayment.value = (0, import_connect_appkit_core24.applySettlementVerification)(
|
|
2700
|
+
current,
|
|
2701
|
+
outcome
|
|
2702
|
+
);
|
|
2703
|
+
}
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2604
2707
|
return result;
|
|
2605
2708
|
}, "Paid request failed");
|
|
2606
2709
|
};
|
|
@@ -2611,22 +2714,150 @@ function usePaymentFetch(pay) {
|
|
|
2611
2714
|
error: guard.error,
|
|
2612
2715
|
reset: () => {
|
|
2613
2716
|
epoch++;
|
|
2717
|
+
verification++;
|
|
2614
2718
|
guard.reset();
|
|
2615
2719
|
lastPayment.value = null;
|
|
2616
2720
|
}
|
|
2617
2721
|
};
|
|
2618
2722
|
}
|
|
2619
2723
|
|
|
2620
|
-
// src/
|
|
2724
|
+
// src/useMppSession.ts
|
|
2621
2725
|
var import_connect_appkit_core25 = require("@naculus/connect-appkit-core");
|
|
2622
|
-
var
|
|
2726
|
+
var import_vue40 = require("vue");
|
|
2727
|
+
function useMppSession(session) {
|
|
2728
|
+
const current = () => (0, import_vue40.unref)(session);
|
|
2729
|
+
const pending = (0, import_vue40.shallowRef)(current().meter.pending);
|
|
2730
|
+
const channel = (0, import_vue40.shallowRef)(
|
|
2731
|
+
(0, import_connect_appkit_core25.readCurrentMppSessionChannel)(current())
|
|
2732
|
+
);
|
|
2733
|
+
const lastReceipt = (0, import_vue40.shallowRef)(null);
|
|
2734
|
+
const recoveryChannelId = (0, import_vue40.shallowRef)(null);
|
|
2735
|
+
const isPending = (0, import_vue40.shallowRef)(false);
|
|
2736
|
+
const error = (0, import_vue40.shallowRef)(null);
|
|
2737
|
+
let active = 0;
|
|
2738
|
+
let generation = 0;
|
|
2739
|
+
let epoch = 0;
|
|
2740
|
+
let disposed = false;
|
|
2741
|
+
(0, import_vue40.watch)(
|
|
2742
|
+
() => (0, import_vue40.unref)(session),
|
|
2743
|
+
(value) => {
|
|
2744
|
+
generation++;
|
|
2745
|
+
epoch++;
|
|
2746
|
+
active = 0;
|
|
2747
|
+
isPending.value = false;
|
|
2748
|
+
pending.value = value.meter.pending;
|
|
2749
|
+
channel.value = (0, import_connect_appkit_core25.readCurrentMppSessionChannel)(value);
|
|
2750
|
+
lastReceipt.value = null;
|
|
2751
|
+
recoveryChannelId.value = null;
|
|
2752
|
+
error.value = null;
|
|
2753
|
+
},
|
|
2754
|
+
{ flush: "sync" }
|
|
2755
|
+
);
|
|
2756
|
+
(0, import_vue40.onScopeDispose)(() => {
|
|
2757
|
+
disposed = true;
|
|
2758
|
+
generation++;
|
|
2759
|
+
epoch++;
|
|
2760
|
+
});
|
|
2761
|
+
const run = (operation, publish, clearsRecovery = false) => {
|
|
2762
|
+
const own = ++generation;
|
|
2763
|
+
const ownEpoch = epoch;
|
|
2764
|
+
const invokedSession = current();
|
|
2765
|
+
active++;
|
|
2766
|
+
isPending.value = true;
|
|
2767
|
+
error.value = null;
|
|
2768
|
+
return operation(invokedSession).then((result) => {
|
|
2769
|
+
if (!disposed && ownEpoch === epoch) {
|
|
2770
|
+
publish?.(result);
|
|
2771
|
+
const currentChannel = (0, import_connect_appkit_core25.readCurrentMppSessionChannel)(invokedSession);
|
|
2772
|
+
channel.value = currentChannel;
|
|
2773
|
+
pending.value = invokedSession.meter.pending;
|
|
2774
|
+
if (clearsRecovery || !currentChannel) {
|
|
2775
|
+
recoveryChannelId.value = null;
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
return result;
|
|
2779
|
+
}).catch((cause) => {
|
|
2780
|
+
const normalized = cause instanceof Error ? cause : new Error("MPP session operation failed");
|
|
2781
|
+
if (!disposed && ownEpoch === epoch) {
|
|
2782
|
+
const currentChannel = (0, import_connect_appkit_core25.readCurrentMppSessionChannel)(invokedSession);
|
|
2783
|
+
channel.value = currentChannel;
|
|
2784
|
+
pending.value = invokedSession.meter.pending;
|
|
2785
|
+
const recovery = (0, import_connect_appkit_core25.readMppRecoveryChannelId)(cause);
|
|
2786
|
+
if (recovery) recoveryChannelId.value = recovery;
|
|
2787
|
+
else if (!currentChannel) recoveryChannelId.value = null;
|
|
2788
|
+
if (own === generation) error.value = normalized;
|
|
2789
|
+
}
|
|
2790
|
+
throw normalized;
|
|
2791
|
+
}).finally(() => {
|
|
2792
|
+
if (ownEpoch === epoch) {
|
|
2793
|
+
active--;
|
|
2794
|
+
if (!disposed) isPending.value = active > 0;
|
|
2795
|
+
}
|
|
2796
|
+
});
|
|
2797
|
+
};
|
|
2798
|
+
const fetch = (input, init) => run(
|
|
2799
|
+
(value) => value(input, init),
|
|
2800
|
+
(result) => {
|
|
2801
|
+
const receipt = (0, import_connect_appkit_core25.readMppSessionReceipt)(result.receipt);
|
|
2802
|
+
if (receipt) lastReceipt.value = receipt;
|
|
2803
|
+
}
|
|
2804
|
+
);
|
|
2805
|
+
const close = () => run(
|
|
2806
|
+
(value) => value.close(),
|
|
2807
|
+
(result) => {
|
|
2808
|
+
const receipt = (0, import_connect_appkit_core25.readMppSessionReceipt)(result.receipt);
|
|
2809
|
+
if (receipt) lastReceipt.value = receipt;
|
|
2810
|
+
},
|
|
2811
|
+
true
|
|
2812
|
+
);
|
|
2813
|
+
const forceClose = () => run((value) => value.forceClose(), void 0, true);
|
|
2814
|
+
const add = (units) => {
|
|
2815
|
+
try {
|
|
2816
|
+
current().meter.add(units);
|
|
2817
|
+
pending.value = current().meter.pending;
|
|
2818
|
+
error.value = null;
|
|
2819
|
+
} catch (cause) {
|
|
2820
|
+
const normalized = cause instanceof Error ? cause : new Error("MPP session operation failed");
|
|
2821
|
+
error.value = normalized;
|
|
2822
|
+
recoveryChannelId.value = (0, import_connect_appkit_core25.readMppRecoveryChannelId)(cause);
|
|
2823
|
+
throw normalized;
|
|
2824
|
+
}
|
|
2825
|
+
};
|
|
2826
|
+
return {
|
|
2827
|
+
fetch,
|
|
2828
|
+
meter: { add },
|
|
2829
|
+
pending,
|
|
2830
|
+
channel,
|
|
2831
|
+
lastReceipt,
|
|
2832
|
+
recoveryChannelId,
|
|
2833
|
+
isPending,
|
|
2834
|
+
error,
|
|
2835
|
+
close,
|
|
2836
|
+
forceClose,
|
|
2837
|
+
reset: () => {
|
|
2838
|
+
generation++;
|
|
2839
|
+
epoch++;
|
|
2840
|
+
active = 0;
|
|
2841
|
+
isPending.value = false;
|
|
2842
|
+
pending.value = current().meter.pending;
|
|
2843
|
+
channel.value = (0, import_connect_appkit_core25.readCurrentMppSessionChannel)(current());
|
|
2844
|
+
lastReceipt.value = null;
|
|
2845
|
+
recoveryChannelId.value = null;
|
|
2846
|
+
error.value = null;
|
|
2847
|
+
}
|
|
2848
|
+
};
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
// src/useSolanaSessionKey.ts
|
|
2852
|
+
var import_connect_appkit_core26 = require("@naculus/connect-appkit-core");
|
|
2853
|
+
var import_vue41 = require("vue");
|
|
2623
2854
|
function useSolanaSessionKey(deps) {
|
|
2624
2855
|
const guard = useActionGuard();
|
|
2625
|
-
const keys = (0,
|
|
2856
|
+
const keys = (0, import_vue41.shallowRef)([]);
|
|
2626
2857
|
let flow = null;
|
|
2627
2858
|
let generation = 0;
|
|
2628
2859
|
let disposed = false;
|
|
2629
|
-
(0,
|
|
2860
|
+
(0, import_vue41.onScopeDispose)(() => {
|
|
2630
2861
|
disposed = true;
|
|
2631
2862
|
});
|
|
2632
2863
|
const refresh = async () => {
|
|
@@ -2634,10 +2865,10 @@ function useSolanaSessionKey(deps) {
|
|
|
2634
2865
|
const next = flow ? await flow.list() : [];
|
|
2635
2866
|
if (!disposed && own === generation) keys.value = next;
|
|
2636
2867
|
};
|
|
2637
|
-
(0,
|
|
2638
|
-
() => (0,
|
|
2868
|
+
(0, import_vue41.watch)(
|
|
2869
|
+
() => (0, import_vue41.unref)(deps),
|
|
2639
2870
|
(next) => {
|
|
2640
|
-
flow = next ? (0,
|
|
2871
|
+
flow = next ? (0, import_connect_appkit_core26.createSolanaSessionKeyFlow)(next) : null;
|
|
2641
2872
|
guard.invalidate();
|
|
2642
2873
|
void refresh().catch(() => {
|
|
2643
2874
|
});
|
|
@@ -2668,17 +2899,17 @@ function useSolanaSessionKey(deps) {
|
|
|
2668
2899
|
}
|
|
2669
2900
|
|
|
2670
2901
|
// src/name-lookup.ts
|
|
2671
|
-
var
|
|
2672
|
-
var
|
|
2902
|
+
var import_connect_appkit_core27 = require("@naculus/connect-appkit-core");
|
|
2903
|
+
var import_vue42 = require("vue");
|
|
2673
2904
|
function useNameLookup(options) {
|
|
2674
2905
|
const guard = useActionGuard();
|
|
2675
|
-
const data = (0,
|
|
2676
|
-
const loading = (0,
|
|
2906
|
+
const data = (0, import_vue42.shallowRef)(null);
|
|
2907
|
+
const loading = (0, import_vue42.shallowRef)(false);
|
|
2677
2908
|
const run = () => {
|
|
2678
|
-
const input = (0,
|
|
2679
|
-
const skip = (0,
|
|
2680
|
-
const scope = (0,
|
|
2681
|
-
const config = (0,
|
|
2909
|
+
const input = (0, import_vue42.toValue)(options.input).trim();
|
|
2910
|
+
const skip = (0, import_vue42.toValue)(options.skip) ?? false;
|
|
2911
|
+
const scope = (0, import_vue42.toValue)(options.scope);
|
|
2912
|
+
const config = (0, import_vue42.toValue)(options.resolverConfig);
|
|
2682
2913
|
if (!input || skip) {
|
|
2683
2914
|
guard.reset();
|
|
2684
2915
|
data.value = null;
|
|
@@ -2691,7 +2922,7 @@ function useNameLookup(options) {
|
|
|
2691
2922
|
async (commit) => {
|
|
2692
2923
|
try {
|
|
2693
2924
|
const result = await Promise.resolve().then(
|
|
2694
|
-
() => options.query((0,
|
|
2925
|
+
() => options.query((0, import_connect_appkit_core27.getResolver)(config), input, scope)
|
|
2695
2926
|
);
|
|
2696
2927
|
commit(() => {
|
|
2697
2928
|
data.value = result;
|
|
@@ -2713,19 +2944,19 @@ function useNameLookup(options) {
|
|
|
2713
2944
|
).catch(() => {
|
|
2714
2945
|
});
|
|
2715
2946
|
};
|
|
2716
|
-
(0,
|
|
2947
|
+
(0, import_vue42.watch)(
|
|
2717
2948
|
() => [
|
|
2718
|
-
(0,
|
|
2719
|
-
(0,
|
|
2720
|
-
(0,
|
|
2721
|
-
(0,
|
|
2949
|
+
(0, import_vue42.toValue)(options.input),
|
|
2950
|
+
(0, import_vue42.toValue)(options.skip),
|
|
2951
|
+
(0, import_vue42.toValue)(options.scope),
|
|
2952
|
+
(0, import_vue42.toValue)(options.resolverConfig)
|
|
2722
2953
|
],
|
|
2723
2954
|
run,
|
|
2724
2955
|
{ immediate: true, flush: "sync", deep: true }
|
|
2725
2956
|
);
|
|
2726
2957
|
return {
|
|
2727
2958
|
data,
|
|
2728
|
-
isLoading: (0,
|
|
2959
|
+
isLoading: (0, import_vue42.computed)(() => loading.value),
|
|
2729
2960
|
error: guard.error,
|
|
2730
2961
|
refetch: run
|
|
2731
2962
|
};
|
|
@@ -2753,21 +2984,21 @@ function useLookupAddress(address, options) {
|
|
|
2753
2984
|
}
|
|
2754
2985
|
|
|
2755
2986
|
// src/useSolanaAccount.ts
|
|
2756
|
-
var
|
|
2987
|
+
var import_vue43 = require("vue");
|
|
2757
2988
|
function useSolanaAccount(accounts, connected) {
|
|
2758
|
-
const isConnected = (0,
|
|
2759
|
-
const caip10 = (0,
|
|
2760
|
-
() => isConnected.value ? ((0,
|
|
2989
|
+
const isConnected = (0, import_vue43.computed)(() => (0, import_vue43.toValue)(connected));
|
|
2990
|
+
const caip10 = (0, import_vue43.computed)(
|
|
2991
|
+
() => isConnected.value ? ((0, import_vue43.toValue)(accounts) ?? []).find(
|
|
2761
2992
|
(account) => account.startsWith("solana:")
|
|
2762
2993
|
) ?? null : null
|
|
2763
2994
|
);
|
|
2764
|
-
const parts = (0,
|
|
2995
|
+
const parts = (0, import_vue43.computed)(() => caip10.value?.split(":") ?? []);
|
|
2765
2996
|
return {
|
|
2766
|
-
address: (0,
|
|
2997
|
+
address: (0, import_vue43.computed)(
|
|
2767
2998
|
() => parts.value.length >= 3 ? parts.value.at(-1) ?? null : null
|
|
2768
2999
|
),
|
|
2769
3000
|
caip10,
|
|
2770
|
-
chainId: (0,
|
|
3001
|
+
chainId: (0, import_vue43.computed)(
|
|
2771
3002
|
() => parts.value.length >= 3 ? parts.value.slice(0, -1).join(":") : null
|
|
2772
3003
|
),
|
|
2773
3004
|
isConnected
|
|
@@ -2775,35 +3006,35 @@ function useSolanaAccount(accounts, connected) {
|
|
|
2775
3006
|
}
|
|
2776
3007
|
|
|
2777
3008
|
// src/useChain.ts
|
|
2778
|
-
var
|
|
2779
|
-
var
|
|
3009
|
+
var import_connect_appkit_core28 = require("@naculus/connect-appkit-core");
|
|
3010
|
+
var import_vue44 = require("vue");
|
|
2780
3011
|
function useChain(chains, chainId) {
|
|
2781
|
-
const list = (0,
|
|
2782
|
-
const id = (0,
|
|
2783
|
-
const currentChain = (0,
|
|
3012
|
+
const list = (0, import_vue44.computed)(() => (0, import_vue44.toValue)(chains) ?? []);
|
|
3013
|
+
const id = (0, import_vue44.computed)(() => (0, import_vue44.toValue)(chainId) ?? null);
|
|
3014
|
+
const currentChain = (0, import_vue44.computed)(() => (0, import_connect_appkit_core28.resolveChain)(list.value, id.value));
|
|
2784
3015
|
return {
|
|
2785
3016
|
currentChain,
|
|
2786
|
-
chainInfo: (0,
|
|
2787
|
-
availableChains: (0,
|
|
2788
|
-
currentChainNumber: (0,
|
|
2789
|
-
() => currentChain.value ? (0,
|
|
3017
|
+
chainInfo: (0, import_vue44.computed)(() => (0, import_connect_appkit_core28.describeChain)(list.value, id.value)),
|
|
3018
|
+
availableChains: (0, import_vue44.computed)(() => (0, import_connect_appkit_core28.chainsForNamespace)(list.value, id.value)),
|
|
3019
|
+
currentChainNumber: (0, import_vue44.computed)(
|
|
3020
|
+
() => currentChain.value ? (0, import_connect_appkit_core28.chainNumber)(currentChain.value) : null
|
|
2790
3021
|
),
|
|
2791
|
-
namespace: (0,
|
|
2792
|
-
() => currentChain.value ? (0,
|
|
3022
|
+
namespace: (0, import_vue44.computed)(
|
|
3023
|
+
() => currentChain.value ? (0, import_connect_appkit_core28.chainNamespace)(currentChain.value) : null
|
|
2793
3024
|
)
|
|
2794
3025
|
};
|
|
2795
3026
|
}
|
|
2796
3027
|
|
|
2797
3028
|
// src/usePassphraseGate.ts
|
|
2798
|
-
var
|
|
3029
|
+
var import_vue45 = require("vue");
|
|
2799
3030
|
function usePassphraseGate(gate) {
|
|
2800
|
-
const request = (0,
|
|
3031
|
+
const request = (0, import_vue45.shallowRef)(gate.getSnapshot());
|
|
2801
3032
|
const unsubscribe = gate.subscribe(() => {
|
|
2802
3033
|
request.value = gate.getSnapshot();
|
|
2803
3034
|
});
|
|
2804
|
-
(0,
|
|
3035
|
+
(0, import_vue45.onScopeDispose)(unsubscribe);
|
|
2805
3036
|
return {
|
|
2806
|
-
request: (0,
|
|
3037
|
+
request: (0, import_vue45.readonly)(request),
|
|
2807
3038
|
submit: (passphrase) => gate.submit(passphrase),
|
|
2808
3039
|
cancel: (reason) => gate.cancel(reason),
|
|
2809
3040
|
forget: (reason) => gate.forget(reason)
|
|
@@ -2811,15 +3042,15 @@ function usePassphraseGate(gate) {
|
|
|
2811
3042
|
}
|
|
2812
3043
|
|
|
2813
3044
|
// src/useSolanaBalance.ts
|
|
2814
|
-
var
|
|
2815
|
-
var
|
|
3045
|
+
var import_connect_core18 = require("@naculus/connect-core");
|
|
3046
|
+
var import_vue46 = require("vue");
|
|
2816
3047
|
function useSolanaBalance(address, rpcUrl) {
|
|
2817
3048
|
const guard = useActionGuard();
|
|
2818
|
-
const balance = (0,
|
|
2819
|
-
const isFetching = (0,
|
|
3049
|
+
const balance = (0, import_vue46.shallowRef)(null);
|
|
3050
|
+
const isFetching = (0, import_vue46.ref)(false);
|
|
2820
3051
|
const refetch = async () => {
|
|
2821
|
-
const addr = (0,
|
|
2822
|
-
const url = (0,
|
|
3052
|
+
const addr = (0, import_vue46.toValue)(address);
|
|
3053
|
+
const url = (0, import_vue46.toValue)(rpcUrl);
|
|
2823
3054
|
if (!addr || !url) {
|
|
2824
3055
|
guard.invalidate();
|
|
2825
3056
|
isFetching.value = false;
|
|
@@ -2830,7 +3061,7 @@ function useSolanaBalance(address, rpcUrl) {
|
|
|
2830
3061
|
await guard.run(
|
|
2831
3062
|
async (commit) => {
|
|
2832
3063
|
try {
|
|
2833
|
-
const next = await (0,
|
|
3064
|
+
const next = await (0, import_connect_core18.getSolanaBalance)(url, addr);
|
|
2834
3065
|
commit(() => {
|
|
2835
3066
|
balance.value = next;
|
|
2836
3067
|
});
|
|
@@ -2851,22 +3082,22 @@ function useSolanaBalance(address, rpcUrl) {
|
|
|
2851
3082
|
).catch(() => {
|
|
2852
3083
|
});
|
|
2853
3084
|
};
|
|
2854
|
-
(0,
|
|
2855
|
-
(0,
|
|
2856
|
-
(0,
|
|
3085
|
+
(0, import_vue46.watchEffect)(() => {
|
|
3086
|
+
(0, import_vue46.toValue)(address);
|
|
3087
|
+
(0, import_vue46.toValue)(rpcUrl);
|
|
2857
3088
|
void refetch();
|
|
2858
3089
|
});
|
|
2859
3090
|
return { balance, isFetching, error: guard.error, refetch };
|
|
2860
3091
|
}
|
|
2861
3092
|
|
|
2862
3093
|
// src/useLastTx.ts
|
|
2863
|
-
var
|
|
3094
|
+
var import_vue47 = require("vue");
|
|
2864
3095
|
function useLastTx(monitor) {
|
|
2865
|
-
const lastTx = (0,
|
|
2866
|
-
const lastConfirmedTx = (0,
|
|
2867
|
-
const lastFailedTx = (0,
|
|
2868
|
-
(0,
|
|
2869
|
-
() => (0,
|
|
3096
|
+
const lastTx = (0, import_vue47.shallowRef)(null);
|
|
3097
|
+
const lastConfirmedTx = (0, import_vue47.shallowRef)(null);
|
|
3098
|
+
const lastFailedTx = (0, import_vue47.shallowRef)(null);
|
|
3099
|
+
(0, import_vue47.watch)(
|
|
3100
|
+
() => (0, import_vue47.toValue)(monitor),
|
|
2870
3101
|
(activeMonitor, _previous, onCleanup) => {
|
|
2871
3102
|
if (!activeMonitor) return;
|
|
2872
3103
|
const recordLatest = (entry) => {
|
|
@@ -2904,13 +3135,13 @@ function useLastTx(monitor) {
|
|
|
2904
3135
|
}
|
|
2905
3136
|
|
|
2906
3137
|
// src/useTxHistory.ts
|
|
2907
|
-
var
|
|
3138
|
+
var import_vue48 = require("vue");
|
|
2908
3139
|
function useTxHistory(address, chainId, monitor) {
|
|
2909
3140
|
const guard = useActionGuard();
|
|
2910
|
-
const entries = (0,
|
|
2911
|
-
const isLoading = (0,
|
|
3141
|
+
const entries = (0, import_vue48.shallowRef)([]);
|
|
3142
|
+
const isLoading = (0, import_vue48.shallowRef)(false);
|
|
2912
3143
|
const refresh = async () => {
|
|
2913
|
-
const activeMonitor = (0,
|
|
3144
|
+
const activeMonitor = (0, import_vue48.toValue)(monitor);
|
|
2914
3145
|
if (!activeMonitor) {
|
|
2915
3146
|
guard.reset();
|
|
2916
3147
|
entries.value = [];
|
|
@@ -2921,8 +3152,8 @@ function useTxHistory(address, chainId, monitor) {
|
|
|
2921
3152
|
await guard.run(
|
|
2922
3153
|
async (commit) => {
|
|
2923
3154
|
const result = await activeMonitor.getTxHistory(
|
|
2924
|
-
(0,
|
|
2925
|
-
(0,
|
|
3155
|
+
(0, import_vue48.toValue)(address) ?? void 0,
|
|
3156
|
+
(0, import_vue48.toValue)(chainId) ?? void 0
|
|
2926
3157
|
);
|
|
2927
3158
|
commit(() => {
|
|
2928
3159
|
entries.value = result;
|
|
@@ -2938,8 +3169,8 @@ function useTxHistory(address, chainId, monitor) {
|
|
|
2938
3169
|
).catch(() => {
|
|
2939
3170
|
});
|
|
2940
3171
|
};
|
|
2941
|
-
(0,
|
|
2942
|
-
[() => (0,
|
|
3172
|
+
(0, import_vue48.watch)(
|
|
3173
|
+
[() => (0, import_vue48.toValue)(monitor), () => (0, import_vue48.toValue)(address), () => (0, import_vue48.toValue)(chainId)],
|
|
2943
3174
|
([activeMonitor], _previous, onCleanup) => {
|
|
2944
3175
|
if (!activeMonitor) {
|
|
2945
3176
|
void refresh();
|
|
@@ -2959,7 +3190,7 @@ function useTxHistory(address, chainId, monitor) {
|
|
|
2959
3190
|
isLoading,
|
|
2960
3191
|
error: guard.error,
|
|
2961
3192
|
refresh,
|
|
2962
|
-
summary: (0,
|
|
3193
|
+
summary: (0, import_vue48.computed)(() => ({
|
|
2963
3194
|
pending: entries.value.filter((item) => item.status === "pending").length,
|
|
2964
3195
|
confirmed: entries.value.filter((item) => item.status === "confirmed").length,
|
|
2965
3196
|
failed: entries.value.filter((item) => item.status === "failed").length
|
|
@@ -2968,25 +3199,25 @@ function useTxHistory(address, chainId, monitor) {
|
|
|
2968
3199
|
}
|
|
2969
3200
|
|
|
2970
3201
|
// src/useTxMonitor.ts
|
|
2971
|
-
var
|
|
3202
|
+
var import_vue49 = require("vue");
|
|
2972
3203
|
function useTxMonitor(hash, chainId, monitor) {
|
|
2973
|
-
const entry = (0,
|
|
2974
|
-
const isLoading = (0,
|
|
2975
|
-
const isWatching = (0,
|
|
3204
|
+
const entry = (0, import_vue49.shallowRef)(null);
|
|
3205
|
+
const isLoading = (0, import_vue49.shallowRef)(false);
|
|
3206
|
+
const isWatching = (0, import_vue49.shallowRef)(false);
|
|
2976
3207
|
const guard = useActionGuard();
|
|
2977
3208
|
const error = guard.error;
|
|
2978
3209
|
let generation = 0;
|
|
2979
3210
|
let refreshed = [];
|
|
2980
3211
|
const currentInputs = () => [
|
|
2981
|
-
(0,
|
|
2982
|
-
(0,
|
|
2983
|
-
(0,
|
|
3212
|
+
(0, import_vue49.toValue)(monitor),
|
|
3213
|
+
(0, import_vue49.toValue)(hash),
|
|
3214
|
+
(0, import_vue49.toValue)(chainId)
|
|
2984
3215
|
];
|
|
2985
3216
|
const sameInputs = (a, b) => a.every((value, i) => Object.is(value, b[i]));
|
|
2986
3217
|
const refresh = async () => {
|
|
2987
|
-
const activeMonitor = (0,
|
|
2988
|
-
const activeHash = (0,
|
|
2989
|
-
const activeChainId = (0,
|
|
3218
|
+
const activeMonitor = (0, import_vue49.toValue)(monitor);
|
|
3219
|
+
const activeHash = (0, import_vue49.toValue)(hash);
|
|
3220
|
+
const activeChainId = (0, import_vue49.toValue)(chainId);
|
|
2990
3221
|
if (!activeMonitor || !activeHash) return;
|
|
2991
3222
|
const started = [activeMonitor, activeHash, activeChainId];
|
|
2992
3223
|
refreshed = started;
|
|
@@ -3022,15 +3253,15 @@ function useTxMonitor(hash, chainId, monitor) {
|
|
|
3022
3253
|
});
|
|
3023
3254
|
};
|
|
3024
3255
|
const stopWatching = () => {
|
|
3025
|
-
const activeMonitor = (0,
|
|
3026
|
-
const activeHash = (0,
|
|
3027
|
-
const activeChainId = (0,
|
|
3256
|
+
const activeMonitor = (0, import_vue49.toValue)(monitor);
|
|
3257
|
+
const activeHash = (0, import_vue49.toValue)(hash);
|
|
3258
|
+
const activeChainId = (0, import_vue49.toValue)(chainId);
|
|
3028
3259
|
if (!activeMonitor || !activeHash) return;
|
|
3029
3260
|
activeMonitor.stopWatching(activeHash, activeChainId ?? void 0);
|
|
3030
3261
|
isWatching.value = false;
|
|
3031
3262
|
};
|
|
3032
|
-
(0,
|
|
3033
|
-
[() => (0,
|
|
3263
|
+
(0, import_vue49.watch)(
|
|
3264
|
+
[() => (0, import_vue49.toValue)(monitor), () => (0, import_vue49.toValue)(hash), () => (0, import_vue49.toValue)(chainId)],
|
|
3034
3265
|
([activeMonitor, activeHash, activeChainId], _previous, onCleanup) => {
|
|
3035
3266
|
const mine = ++generation;
|
|
3036
3267
|
if (!sameInputs([activeMonitor, activeHash, activeChainId], refreshed)) {
|
|
@@ -3072,7 +3303,7 @@ function useTxMonitor(hash, chainId, monitor) {
|
|
|
3072
3303
|
);
|
|
3073
3304
|
return {
|
|
3074
3305
|
entry,
|
|
3075
|
-
status: (0,
|
|
3306
|
+
status: (0, import_vue49.computed)(() => entry.value?.status ?? "idle"),
|
|
3076
3307
|
isLoading,
|
|
3077
3308
|
isWatching,
|
|
3078
3309
|
error,
|
|
@@ -3082,17 +3313,17 @@ function useTxMonitor(hash, chainId, monitor) {
|
|
|
3082
3313
|
}
|
|
3083
3314
|
|
|
3084
3315
|
// src/useCapabilities.ts
|
|
3085
|
-
var
|
|
3086
|
-
var
|
|
3316
|
+
var import_connect_appkit_core29 = require("@naculus/connect-appkit-core");
|
|
3317
|
+
var import_vue50 = require("vue");
|
|
3087
3318
|
function useCapabilities(client, session, chainId) {
|
|
3088
3319
|
const guard = useActionGuard();
|
|
3089
|
-
const capabilities = (0,
|
|
3320
|
+
const capabilities = (0, import_vue50.shallowRef)(
|
|
3090
3321
|
null
|
|
3091
3322
|
);
|
|
3092
|
-
const isFetching = (0,
|
|
3323
|
+
const isFetching = (0, import_vue50.shallowRef)(false);
|
|
3093
3324
|
const refetch = async () => {
|
|
3094
|
-
const activeClient = (0,
|
|
3095
|
-
const activeSession = (0,
|
|
3325
|
+
const activeClient = (0, import_vue50.toValue)(client);
|
|
3326
|
+
const activeSession = (0, import_vue50.toValue)(session);
|
|
3096
3327
|
if (!activeClient?.getCapabilities || !activeSession) {
|
|
3097
3328
|
guard.reset();
|
|
3098
3329
|
capabilities.value = null;
|
|
@@ -3105,7 +3336,7 @@ function useCapabilities(client, session, chainId) {
|
|
|
3105
3336
|
try {
|
|
3106
3337
|
const raw = await activeClient.getCapabilities(activeSession);
|
|
3107
3338
|
commit(() => {
|
|
3108
|
-
capabilities.value = (0,
|
|
3339
|
+
capabilities.value = (0, import_connect_appkit_core29.normalizeCapabilities)(raw);
|
|
3109
3340
|
});
|
|
3110
3341
|
} catch (err) {
|
|
3111
3342
|
commit(() => {
|
|
@@ -3124,18 +3355,18 @@ function useCapabilities(client, session, chainId) {
|
|
|
3124
3355
|
).catch(() => {
|
|
3125
3356
|
});
|
|
3126
3357
|
};
|
|
3127
|
-
(0,
|
|
3128
|
-
void (0,
|
|
3129
|
-
void (0,
|
|
3358
|
+
(0, import_vue50.watchEffect)(() => {
|
|
3359
|
+
void (0, import_vue50.toValue)(client);
|
|
3360
|
+
void (0, import_vue50.toValue)(session);
|
|
3130
3361
|
void refetch();
|
|
3131
3362
|
});
|
|
3132
3363
|
return {
|
|
3133
3364
|
capabilities,
|
|
3134
|
-
current: (0,
|
|
3135
|
-
() => (0,
|
|
3365
|
+
current: (0, import_vue50.computed)(
|
|
3366
|
+
() => (0, import_connect_appkit_core29.selectChainCapabilities)(capabilities.value, (0, import_vue50.toValue)(chainId))
|
|
3136
3367
|
),
|
|
3137
|
-
atomic: (0,
|
|
3138
|
-
() => (0,
|
|
3368
|
+
atomic: (0, import_vue50.computed)(
|
|
3369
|
+
() => (0, import_connect_appkit_core29.atomicSupportFor)(capabilities.value, (0, import_vue50.toValue)(chainId))
|
|
3139
3370
|
),
|
|
3140
3371
|
isFetching,
|
|
3141
3372
|
error: guard.error,
|
|
@@ -3144,18 +3375,18 @@ function useCapabilities(client, session, chainId) {
|
|
|
3144
3375
|
}
|
|
3145
3376
|
|
|
3146
3377
|
// src/useSolanaRoles.ts
|
|
3147
|
-
var
|
|
3148
|
-
var
|
|
3378
|
+
var import_connect_appkit_core30 = require("@naculus/connect-appkit-core");
|
|
3379
|
+
var import_vue51 = require("vue");
|
|
3149
3380
|
function useSolanaRoles(connector, session) {
|
|
3150
|
-
const state = (0,
|
|
3151
|
-
() => (0,
|
|
3381
|
+
const state = (0, import_vue51.computed)(
|
|
3382
|
+
() => (0, import_connect_appkit_core30.readSolanaRoles)((0, import_vue51.toValue)(connector), (0, import_vue51.toValue)(session))
|
|
3152
3383
|
);
|
|
3153
3384
|
return {
|
|
3154
|
-
roles: (0,
|
|
3155
|
-
absence: (0,
|
|
3156
|
-
identity: (0,
|
|
3157
|
-
signer: (0,
|
|
3158
|
-
payer: (0,
|
|
3385
|
+
roles: (0, import_vue51.computed)(() => state.value.roles),
|
|
3386
|
+
absence: (0, import_vue51.computed)(() => state.value.absence),
|
|
3387
|
+
identity: (0, import_vue51.computed)(() => state.value.roles?.identity ?? null),
|
|
3388
|
+
signer: (0, import_vue51.computed)(() => state.value.roles?.signer ?? null),
|
|
3389
|
+
payer: (0, import_vue51.computed)(() => state.value.roles?.payer ?? null)
|
|
3159
3390
|
};
|
|
3160
3391
|
}
|
|
3161
3392
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -3190,6 +3421,7 @@ function useSolanaRoles(connector, session) {
|
|
|
3190
3421
|
AppkitTooltip,
|
|
3191
3422
|
useAccount,
|
|
3192
3423
|
useAccounts,
|
|
3424
|
+
useAuthorizations,
|
|
3193
3425
|
useBalance,
|
|
3194
3426
|
useCapabilities,
|
|
3195
3427
|
useChain,
|
|
@@ -3208,6 +3440,7 @@ function useSolanaRoles(connector, session) {
|
|
|
3208
3440
|
useExecuteRoute,
|
|
3209
3441
|
useLastTx,
|
|
3210
3442
|
useLookupAddress,
|
|
3443
|
+
useMppSession,
|
|
3211
3444
|
useNotification,
|
|
3212
3445
|
usePassphraseGate,
|
|
3213
3446
|
usePaymentFetch,
|