@txnlab/use-wallet-solid 4.0.1 → 4.2.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/dist/dev.cjs CHANGED
@@ -8,7 +8,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var algosdk__default = /*#__PURE__*/_interopDefault(algosdk);
10
10
 
11
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
11
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
12
12
  var sharedConfig = {
13
13
  context: void 0,
14
14
  registry: void 0,
@@ -236,11 +236,7 @@ function updateComputation(node) {
236
236
  if (!node.fn) return;
237
237
  cleanNode(node);
238
238
  const time = ExecCount;
239
- runComputation(
240
- node,
241
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
242
- time
243
- );
239
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
244
240
  if (Transition && !Transition.running && Transition.sources.has(node)) {
245
241
  queueMicrotask(() => {
246
242
  runUpdates(() => {
@@ -471,8 +467,7 @@ function lookUpstream(node, ignore) {
471
467
  if (source.sources) {
472
468
  const state = runningTransition ? source.tState : source.state;
473
469
  if (state === STALE) {
474
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
475
- runTop(source);
470
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
476
471
  } else if (state === PENDING) lookUpstream(source, ignore);
477
472
  }
478
473
  }
@@ -548,13 +543,12 @@ function handleError(err, owner = Owner) {
548
543
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
549
544
  const error = castError(err);
550
545
  if (!fns) throw error;
551
- if (Effects)
552
- Effects.push({
553
- fn() {
554
- runErrors(error, fns, owner);
555
- },
556
- state: STALE
557
- });
546
+ if (Effects) Effects.push({
547
+ fn() {
548
+ runErrors(error, fns, owner);
549
+ },
550
+ state: STALE
551
+ });
558
552
  else runErrors(error, fns, owner);
559
553
  }
560
554
  function resolveChildren(children2) {
@@ -572,16 +566,13 @@ function resolveChildren(children2) {
572
566
  function createProvider(id, options) {
573
567
  return function provider(props) {
574
568
  let res;
575
- createRenderEffect(
576
- () => res = untrack(() => {
577
- Owner.context = {
578
- ...Owner.context,
579
- [id]: props.value
580
- };
581
- return children(() => props.children);
582
- }),
583
- void 0
584
- );
569
+ createRenderEffect(() => res = untrack(() => {
570
+ Owner.context = {
571
+ ...Owner.context,
572
+ [id]: props.value
573
+ };
574
+ return children(() => props.children);
575
+ }), void 0);
585
576
  return res;
586
577
  };
587
578
  }
@@ -599,44 +590,9 @@ function createComponent(Comp, props) {
599
590
  return untrack(() => Comp(props || {}));
600
591
  }
601
592
 
602
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
603
- var booleans = [
604
- "allowfullscreen",
605
- "async",
606
- "autofocus",
607
- "autoplay",
608
- "checked",
609
- "controls",
610
- "default",
611
- "disabled",
612
- "formnovalidate",
613
- "hidden",
614
- "indeterminate",
615
- "inert",
616
- "ismap",
617
- "loop",
618
- "multiple",
619
- "muted",
620
- "nomodule",
621
- "novalidate",
622
- "open",
623
- "playsinline",
624
- "readonly",
625
- "required",
626
- "reversed",
627
- "seamless",
628
- "selected"
629
- ];
630
- /* @__PURE__ */ new Set([
631
- "className",
632
- "value",
633
- "readOnly",
634
- "formNoValidate",
635
- "isMap",
636
- "noModule",
637
- "playsInline",
638
- ...booleans
639
- ]);
593
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/web/dist/web.js
594
+ var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
595
+ /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
640
596
  var WalletContext = createContext();
641
597
  exports.WalletProvider = (props) => {
642
598
  const store = () => props.manager;
@@ -773,6 +729,13 @@ exports.useWallet = () => {
773
729
  }
774
730
  return wallet.transactionSigner(txnGroup, indexesToSign);
775
731
  };
732
+ const signData = (data, metadata) => {
733
+ const wallet = activeWallet();
734
+ if (!wallet) {
735
+ throw new Error("No active wallet");
736
+ }
737
+ return wallet.signData(data, metadata);
738
+ };
776
739
  return {
777
740
  wallets: manager().wallets,
778
741
  isReady,
@@ -784,11 +747,12 @@ exports.useWallet = () => {
784
747
  activeAccount,
785
748
  activeAddress,
786
749
  activeWalletId,
787
- walletStore,
788
750
  isWalletActive,
789
751
  isWalletConnected,
752
+ signData,
790
753
  signTransactions,
791
- transactionSigner
754
+ transactionSigner,
755
+ walletStore
792
756
  };
793
757
  };
794
758
 
package/dist/dev.js CHANGED
@@ -2,7 +2,7 @@ import { useStore } from '@tanstack/solid-store';
2
2
  import algosdk from 'algosdk';
3
3
  export * from '@txnlab/use-wallet';
4
4
 
5
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
5
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
6
6
  var sharedConfig = {
7
7
  context: void 0,
8
8
  registry: void 0,
@@ -230,11 +230,7 @@ function updateComputation(node) {
230
230
  if (!node.fn) return;
231
231
  cleanNode(node);
232
232
  const time = ExecCount;
233
- runComputation(
234
- node,
235
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
236
- time
237
- );
233
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
238
234
  if (Transition && !Transition.running && Transition.sources.has(node)) {
239
235
  queueMicrotask(() => {
240
236
  runUpdates(() => {
@@ -465,8 +461,7 @@ function lookUpstream(node, ignore) {
465
461
  if (source.sources) {
466
462
  const state = runningTransition ? source.tState : source.state;
467
463
  if (state === STALE) {
468
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
469
- runTop(source);
464
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
470
465
  } else if (state === PENDING) lookUpstream(source, ignore);
471
466
  }
472
467
  }
@@ -542,13 +537,12 @@ function handleError(err, owner = Owner) {
542
537
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
543
538
  const error = castError(err);
544
539
  if (!fns) throw error;
545
- if (Effects)
546
- Effects.push({
547
- fn() {
548
- runErrors(error, fns, owner);
549
- },
550
- state: STALE
551
- });
540
+ if (Effects) Effects.push({
541
+ fn() {
542
+ runErrors(error, fns, owner);
543
+ },
544
+ state: STALE
545
+ });
552
546
  else runErrors(error, fns, owner);
553
547
  }
554
548
  function resolveChildren(children2) {
@@ -566,16 +560,13 @@ function resolveChildren(children2) {
566
560
  function createProvider(id, options) {
567
561
  return function provider(props) {
568
562
  let res;
569
- createRenderEffect(
570
- () => res = untrack(() => {
571
- Owner.context = {
572
- ...Owner.context,
573
- [id]: props.value
574
- };
575
- return children(() => props.children);
576
- }),
577
- void 0
578
- );
563
+ createRenderEffect(() => res = untrack(() => {
564
+ Owner.context = {
565
+ ...Owner.context,
566
+ [id]: props.value
567
+ };
568
+ return children(() => props.children);
569
+ }), void 0);
579
570
  return res;
580
571
  };
581
572
  }
@@ -593,44 +584,9 @@ function createComponent(Comp, props) {
593
584
  return untrack(() => Comp(props || {}));
594
585
  }
595
586
 
596
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
597
- var booleans = [
598
- "allowfullscreen",
599
- "async",
600
- "autofocus",
601
- "autoplay",
602
- "checked",
603
- "controls",
604
- "default",
605
- "disabled",
606
- "formnovalidate",
607
- "hidden",
608
- "indeterminate",
609
- "inert",
610
- "ismap",
611
- "loop",
612
- "multiple",
613
- "muted",
614
- "nomodule",
615
- "novalidate",
616
- "open",
617
- "playsinline",
618
- "readonly",
619
- "required",
620
- "reversed",
621
- "seamless",
622
- "selected"
623
- ];
624
- /* @__PURE__ */ new Set([
625
- "className",
626
- "value",
627
- "readOnly",
628
- "formNoValidate",
629
- "isMap",
630
- "noModule",
631
- "playsInline",
632
- ...booleans
633
- ]);
587
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/web/dist/web.js
588
+ var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
589
+ /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
634
590
  var WalletContext = createContext();
635
591
  var WalletProvider = (props) => {
636
592
  const store = () => props.manager;
@@ -767,6 +723,13 @@ var useWallet = () => {
767
723
  }
768
724
  return wallet.transactionSigner(txnGroup, indexesToSign);
769
725
  };
726
+ const signData = (data, metadata) => {
727
+ const wallet = activeWallet();
728
+ if (!wallet) {
729
+ throw new Error("No active wallet");
730
+ }
731
+ return wallet.signData(data, metadata);
732
+ };
770
733
  return {
771
734
  wallets: manager().wallets,
772
735
  isReady,
@@ -778,11 +741,12 @@ var useWallet = () => {
778
741
  activeAccount,
779
742
  activeAddress,
780
743
  activeWalletId,
781
- walletStore,
782
744
  isWalletActive,
783
745
  isWalletConnected,
746
+ signData,
784
747
  signTransactions,
785
- transactionSigner
748
+ transactionSigner,
749
+ walletStore
786
750
  };
787
751
  };
788
752
 
package/dist/dev.jsx CHANGED
@@ -2,7 +2,7 @@
2
2
  import { useStore } from "@tanstack/solid-store";
3
3
  import algosdk from "algosdk";
4
4
 
5
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
5
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
6
6
  var sharedConfig = {
7
7
  context: void 0,
8
8
  registry: void 0,
@@ -230,11 +230,7 @@ function updateComputation(node) {
230
230
  if (!node.fn) return;
231
231
  cleanNode(node);
232
232
  const time = ExecCount;
233
- runComputation(
234
- node,
235
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
236
- time
237
- );
233
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
238
234
  if (Transition && !Transition.running && Transition.sources.has(node)) {
239
235
  queueMicrotask(() => {
240
236
  runUpdates(() => {
@@ -465,8 +461,7 @@ function lookUpstream(node, ignore) {
465
461
  if (source.sources) {
466
462
  const state = runningTransition ? source.tState : source.state;
467
463
  if (state === STALE) {
468
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
469
- runTop(source);
464
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
470
465
  } else if (state === PENDING) lookUpstream(source, ignore);
471
466
  }
472
467
  }
@@ -542,13 +537,12 @@ function handleError(err, owner = Owner) {
542
537
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
543
538
  const error = castError(err);
544
539
  if (!fns) throw error;
545
- if (Effects)
546
- Effects.push({
547
- fn() {
548
- runErrors(error, fns, owner);
549
- },
550
- state: STALE
551
- });
540
+ if (Effects) Effects.push({
541
+ fn() {
542
+ runErrors(error, fns, owner);
543
+ },
544
+ state: STALE
545
+ });
552
546
  else runErrors(error, fns, owner);
553
547
  }
554
548
  function resolveChildren(children2) {
@@ -566,16 +560,13 @@ function resolveChildren(children2) {
566
560
  function createProvider(id, options) {
567
561
  return function provider(props) {
568
562
  let res;
569
- createRenderEffect(
570
- () => res = untrack(() => {
571
- Owner.context = {
572
- ...Owner.context,
573
- [id]: props.value
574
- };
575
- return children(() => props.children);
576
- }),
577
- void 0
578
- );
563
+ createRenderEffect(() => res = untrack(() => {
564
+ Owner.context = {
565
+ ...Owner.context,
566
+ [id]: props.value
567
+ };
568
+ return children(() => props.children);
569
+ }), void 0);
579
570
  return res;
580
571
  };
581
572
  }
@@ -693,6 +684,13 @@ var useWallet = () => {
693
684
  }
694
685
  return wallet.transactionSigner(txnGroup, indexesToSign);
695
686
  };
687
+ const signData = (data, metadata) => {
688
+ const wallet = activeWallet();
689
+ if (!wallet) {
690
+ throw new Error("No active wallet");
691
+ }
692
+ return wallet.signData(data, metadata);
693
+ };
696
694
  return {
697
695
  wallets: manager().wallets,
698
696
  isReady,
@@ -704,11 +702,12 @@ var useWallet = () => {
704
702
  activeAccount,
705
703
  activeAddress,
706
704
  activeWalletId,
707
- walletStore,
708
705
  isWalletActive,
709
706
  isWalletConnected,
707
+ signData,
710
708
  signTransactions,
711
- transactionSigner
709
+ transactionSigner,
710
+ walletStore
712
711
  };
713
712
  };
714
713
  export {
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var algosdk__default = /*#__PURE__*/_interopDefault(algosdk);
10
10
 
11
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
11
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
12
12
  var sharedConfig = {
13
13
  context: void 0,
14
14
  registry: void 0,
@@ -236,11 +236,7 @@ function updateComputation(node) {
236
236
  if (!node.fn) return;
237
237
  cleanNode(node);
238
238
  const time = ExecCount;
239
- runComputation(
240
- node,
241
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
242
- time
243
- );
239
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
244
240
  if (Transition && !Transition.running && Transition.sources.has(node)) {
245
241
  queueMicrotask(() => {
246
242
  runUpdates(() => {
@@ -471,8 +467,7 @@ function lookUpstream(node, ignore) {
471
467
  if (source.sources) {
472
468
  const state = runningTransition ? source.tState : source.state;
473
469
  if (state === STALE) {
474
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
475
- runTop(source);
470
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
476
471
  } else if (state === PENDING) lookUpstream(source, ignore);
477
472
  }
478
473
  }
@@ -548,13 +543,12 @@ function handleError(err, owner = Owner) {
548
543
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
549
544
  const error = castError(err);
550
545
  if (!fns) throw error;
551
- if (Effects)
552
- Effects.push({
553
- fn() {
554
- runErrors(error, fns, owner);
555
- },
556
- state: STALE
557
- });
546
+ if (Effects) Effects.push({
547
+ fn() {
548
+ runErrors(error, fns, owner);
549
+ },
550
+ state: STALE
551
+ });
558
552
  else runErrors(error, fns, owner);
559
553
  }
560
554
  function resolveChildren(children2) {
@@ -572,16 +566,13 @@ function resolveChildren(children2) {
572
566
  function createProvider(id, options) {
573
567
  return function provider(props) {
574
568
  let res;
575
- createRenderEffect(
576
- () => res = untrack(() => {
577
- Owner.context = {
578
- ...Owner.context,
579
- [id]: props.value
580
- };
581
- return children(() => props.children);
582
- }),
583
- void 0
584
- );
569
+ createRenderEffect(() => res = untrack(() => {
570
+ Owner.context = {
571
+ ...Owner.context,
572
+ [id]: props.value
573
+ };
574
+ return children(() => props.children);
575
+ }), void 0);
585
576
  return res;
586
577
  };
587
578
  }
@@ -599,44 +590,9 @@ function createComponent(Comp, props) {
599
590
  return untrack(() => Comp(props || {}));
600
591
  }
601
592
 
602
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
603
- var booleans = [
604
- "allowfullscreen",
605
- "async",
606
- "autofocus",
607
- "autoplay",
608
- "checked",
609
- "controls",
610
- "default",
611
- "disabled",
612
- "formnovalidate",
613
- "hidden",
614
- "indeterminate",
615
- "inert",
616
- "ismap",
617
- "loop",
618
- "multiple",
619
- "muted",
620
- "nomodule",
621
- "novalidate",
622
- "open",
623
- "playsinline",
624
- "readonly",
625
- "required",
626
- "reversed",
627
- "seamless",
628
- "selected"
629
- ];
630
- /* @__PURE__ */ new Set([
631
- "className",
632
- "value",
633
- "readOnly",
634
- "formNoValidate",
635
- "isMap",
636
- "noModule",
637
- "playsInline",
638
- ...booleans
639
- ]);
593
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/web/dist/web.js
594
+ var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
595
+ /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
640
596
  var WalletContext = createContext();
641
597
  exports.WalletProvider = (props) => {
642
598
  const store = () => props.manager;
@@ -768,6 +724,13 @@ exports.useWallet = () => {
768
724
  }
769
725
  return wallet.transactionSigner(txnGroup, indexesToSign);
770
726
  };
727
+ const signData = (data, metadata) => {
728
+ const wallet = activeWallet();
729
+ if (!wallet) {
730
+ throw new Error("No active wallet");
731
+ }
732
+ return wallet.signData(data, metadata);
733
+ };
771
734
  return {
772
735
  wallets: manager().wallets,
773
736
  isReady,
@@ -779,11 +742,12 @@ exports.useWallet = () => {
779
742
  activeAccount,
780
743
  activeAddress,
781
744
  activeWalletId,
782
- walletStore,
783
745
  isWalletActive,
784
746
  isWalletConnected,
747
+ signData,
785
748
  signTransactions,
786
- transactionSigner
749
+ transactionSigner,
750
+ walletStore
787
751
  };
788
752
  };
789
753
 
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _txnlab_use_wallet from '@txnlab/use-wallet';
2
- import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId } from '@txnlab/use-wallet';
2
+ import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId, SignMetadata, SignDataResponse } from '@txnlab/use-wallet';
3
3
  export * from '@txnlab/use-wallet';
4
4
  import * as solid_js from 'solid-js';
5
5
  import { JSX } from 'solid-js';
@@ -30,11 +30,12 @@ declare const useWallet: () => {
30
30
  activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
31
31
  activeAddress: () => string | null;
32
32
  activeWalletId: solid_js.Accessor<WalletId | null>;
33
- walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
34
33
  isWalletActive: (walletId: WalletId) => boolean;
35
34
  isWalletConnected: (walletId: WalletId) => boolean;
35
+ signData: (data: string, metadata: SignMetadata) => Promise<SignDataResponse>;
36
36
  signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
37
37
  transactionSigner: (txnGroup: algosdk.Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>;
38
+ walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
38
39
  };
39
40
 
40
41
  export { WalletProvider, useNetwork, useWallet, useWalletManager };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _txnlab_use_wallet from '@txnlab/use-wallet';
2
- import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId } from '@txnlab/use-wallet';
2
+ import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId, SignMetadata, SignDataResponse } from '@txnlab/use-wallet';
3
3
  export * from '@txnlab/use-wallet';
4
4
  import * as solid_js from 'solid-js';
5
5
  import { JSX } from 'solid-js';
@@ -30,11 +30,12 @@ declare const useWallet: () => {
30
30
  activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
31
31
  activeAddress: () => string | null;
32
32
  activeWalletId: solid_js.Accessor<WalletId | null>;
33
- walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
34
33
  isWalletActive: (walletId: WalletId) => boolean;
35
34
  isWalletConnected: (walletId: WalletId) => boolean;
35
+ signData: (data: string, metadata: SignMetadata) => Promise<SignDataResponse>;
36
36
  signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
37
37
  transactionSigner: (txnGroup: algosdk.Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>;
38
+ walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
38
39
  };
39
40
 
40
41
  export { WalletProvider, useNetwork, useWallet, useWalletManager };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { useStore } from '@tanstack/solid-store';
2
2
  import algosdk from 'algosdk';
3
3
  export * from '@txnlab/use-wallet';
4
4
 
5
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
5
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
6
6
  var sharedConfig = {
7
7
  context: void 0,
8
8
  registry: void 0,
@@ -230,11 +230,7 @@ function updateComputation(node) {
230
230
  if (!node.fn) return;
231
231
  cleanNode(node);
232
232
  const time = ExecCount;
233
- runComputation(
234
- node,
235
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
236
- time
237
- );
233
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
238
234
  if (Transition && !Transition.running && Transition.sources.has(node)) {
239
235
  queueMicrotask(() => {
240
236
  runUpdates(() => {
@@ -465,8 +461,7 @@ function lookUpstream(node, ignore) {
465
461
  if (source.sources) {
466
462
  const state = runningTransition ? source.tState : source.state;
467
463
  if (state === STALE) {
468
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
469
- runTop(source);
464
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
470
465
  } else if (state === PENDING) lookUpstream(source, ignore);
471
466
  }
472
467
  }
@@ -542,13 +537,12 @@ function handleError(err, owner = Owner) {
542
537
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
543
538
  const error = castError(err);
544
539
  if (!fns) throw error;
545
- if (Effects)
546
- Effects.push({
547
- fn() {
548
- runErrors(error, fns, owner);
549
- },
550
- state: STALE
551
- });
540
+ if (Effects) Effects.push({
541
+ fn() {
542
+ runErrors(error, fns, owner);
543
+ },
544
+ state: STALE
545
+ });
552
546
  else runErrors(error, fns, owner);
553
547
  }
554
548
  function resolveChildren(children2) {
@@ -566,16 +560,13 @@ function resolveChildren(children2) {
566
560
  function createProvider(id, options) {
567
561
  return function provider(props) {
568
562
  let res;
569
- createRenderEffect(
570
- () => res = untrack(() => {
571
- Owner.context = {
572
- ...Owner.context,
573
- [id]: props.value
574
- };
575
- return children(() => props.children);
576
- }),
577
- void 0
578
- );
563
+ createRenderEffect(() => res = untrack(() => {
564
+ Owner.context = {
565
+ ...Owner.context,
566
+ [id]: props.value
567
+ };
568
+ return children(() => props.children);
569
+ }), void 0);
579
570
  return res;
580
571
  };
581
572
  }
@@ -593,44 +584,9 @@ function createComponent(Comp, props) {
593
584
  return untrack(() => Comp(props || {}));
594
585
  }
595
586
 
596
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
597
- var booleans = [
598
- "allowfullscreen",
599
- "async",
600
- "autofocus",
601
- "autoplay",
602
- "checked",
603
- "controls",
604
- "default",
605
- "disabled",
606
- "formnovalidate",
607
- "hidden",
608
- "indeterminate",
609
- "inert",
610
- "ismap",
611
- "loop",
612
- "multiple",
613
- "muted",
614
- "nomodule",
615
- "novalidate",
616
- "open",
617
- "playsinline",
618
- "readonly",
619
- "required",
620
- "reversed",
621
- "seamless",
622
- "selected"
623
- ];
624
- /* @__PURE__ */ new Set([
625
- "className",
626
- "value",
627
- "readOnly",
628
- "formNoValidate",
629
- "isMap",
630
- "noModule",
631
- "playsInline",
632
- ...booleans
633
- ]);
587
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/web/dist/web.js
588
+ var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
589
+ /* @__PURE__ */ new Set(["className", "value", "readOnly", "noValidate", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
634
590
  var WalletContext = createContext();
635
591
  var WalletProvider = (props) => {
636
592
  const store = () => props.manager;
@@ -762,6 +718,13 @@ var useWallet = () => {
762
718
  }
763
719
  return wallet.transactionSigner(txnGroup, indexesToSign);
764
720
  };
721
+ const signData = (data, metadata) => {
722
+ const wallet = activeWallet();
723
+ if (!wallet) {
724
+ throw new Error("No active wallet");
725
+ }
726
+ return wallet.signData(data, metadata);
727
+ };
765
728
  return {
766
729
  wallets: manager().wallets,
767
730
  isReady,
@@ -773,11 +736,12 @@ var useWallet = () => {
773
736
  activeAccount,
774
737
  activeAddress,
775
738
  activeWalletId,
776
- walletStore,
777
739
  isWalletActive,
778
740
  isWalletConnected,
741
+ signData,
779
742
  signTransactions,
780
- transactionSigner
743
+ transactionSigner,
744
+ walletStore
781
745
  };
782
746
  };
783
747
 
package/dist/index.jsx CHANGED
@@ -2,7 +2,7 @@
2
2
  import { useStore } from "@tanstack/solid-store";
3
3
  import algosdk from "algosdk";
4
4
 
5
- // ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
5
+ // ../../node_modules/.pnpm/solid-js@1.9.7/node_modules/solid-js/dist/solid.js
6
6
  var sharedConfig = {
7
7
  context: void 0,
8
8
  registry: void 0,
@@ -230,11 +230,7 @@ function updateComputation(node) {
230
230
  if (!node.fn) return;
231
231
  cleanNode(node);
232
232
  const time = ExecCount;
233
- runComputation(
234
- node,
235
- Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value,
236
- time
237
- );
233
+ runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
238
234
  if (Transition && !Transition.running && Transition.sources.has(node)) {
239
235
  queueMicrotask(() => {
240
236
  runUpdates(() => {
@@ -465,8 +461,7 @@ function lookUpstream(node, ignore) {
465
461
  if (source.sources) {
466
462
  const state = runningTransition ? source.tState : source.state;
467
463
  if (state === STALE) {
468
- if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
469
- runTop(source);
464
+ if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
470
465
  } else if (state === PENDING) lookUpstream(source, ignore);
471
466
  }
472
467
  }
@@ -542,13 +537,12 @@ function handleError(err, owner = Owner) {
542
537
  const fns = ERROR && owner && owner.context && owner.context[ERROR];
543
538
  const error = castError(err);
544
539
  if (!fns) throw error;
545
- if (Effects)
546
- Effects.push({
547
- fn() {
548
- runErrors(error, fns, owner);
549
- },
550
- state: STALE
551
- });
540
+ if (Effects) Effects.push({
541
+ fn() {
542
+ runErrors(error, fns, owner);
543
+ },
544
+ state: STALE
545
+ });
552
546
  else runErrors(error, fns, owner);
553
547
  }
554
548
  function resolveChildren(children2) {
@@ -566,16 +560,13 @@ function resolveChildren(children2) {
566
560
  function createProvider(id, options) {
567
561
  return function provider(props) {
568
562
  let res;
569
- createRenderEffect(
570
- () => res = untrack(() => {
571
- Owner.context = {
572
- ...Owner.context,
573
- [id]: props.value
574
- };
575
- return children(() => props.children);
576
- }),
577
- void 0
578
- );
563
+ createRenderEffect(() => res = untrack(() => {
564
+ Owner.context = {
565
+ ...Owner.context,
566
+ [id]: props.value
567
+ };
568
+ return children(() => props.children);
569
+ }), void 0);
579
570
  return res;
580
571
  };
581
572
  }
@@ -688,6 +679,13 @@ var useWallet = () => {
688
679
  }
689
680
  return wallet.transactionSigner(txnGroup, indexesToSign);
690
681
  };
682
+ const signData = (data, metadata) => {
683
+ const wallet = activeWallet();
684
+ if (!wallet) {
685
+ throw new Error("No active wallet");
686
+ }
687
+ return wallet.signData(data, metadata);
688
+ };
691
689
  return {
692
690
  wallets: manager().wallets,
693
691
  isReady,
@@ -699,11 +697,12 @@ var useWallet = () => {
699
697
  activeAccount,
700
698
  activeAddress,
701
699
  activeWalletId,
702
- walletStore,
703
700
  isWalletActive,
704
701
  isWalletConnected,
702
+ signData,
705
703
  signTransactions,
706
- transactionSigner
704
+ transactionSigner,
705
+ walletStore
707
706
  };
708
707
  };
709
708
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@txnlab/use-wallet-solid",
3
- "version": "4.0.1",
3
+ "version": "4.2.0",
4
4
  "description": "Solid.js library for integrating Algorand wallets into decentralized applications",
5
5
  "author": "Doug Richar <drichar@gmail.com>",
6
6
  "license": "MIT",
@@ -53,26 +53,26 @@
53
53
  "dist"
54
54
  ],
55
55
  "dependencies": {
56
- "@tanstack/solid-store": "0.7.0",
57
- "@txnlab/use-wallet": "4.0.1"
56
+ "@tanstack/solid-store": "0.7.1",
57
+ "@txnlab/use-wallet": "4.2.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@solidjs/testing-library": "0.8.10",
61
- "algosdk": "3.2.0",
62
- "solid-js": "1.9.5",
63
- "tsup": "8.4.0",
61
+ "algosdk": "3.3.1",
62
+ "solid-js": "1.9.7",
63
+ "tsup": "8.5.0",
64
64
  "tsup-preset-solid": "2.2.0",
65
- "typescript": "5.8.2"
65
+ "typescript": "5.8.3"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "@blockshake/defly-connect": "^1.2.1",
69
- "@magic-ext/algorand": "^23.20.0",
69
+ "@magic-ext/algorand": "^24.1.0",
70
70
  "@perawallet/connect": "^1.4.1",
71
71
  "@walletconnect/modal": "^2.7.0",
72
- "@walletconnect/sign-client": "^2.19.2",
72
+ "@walletconnect/sign-client": "^2.21.3",
73
73
  "algosdk": "^3.0.0",
74
- "lute-connect": "^1.5.1",
75
- "magic-sdk": "^28.21.1"
74
+ "lute-connect": "^1.6.1",
75
+ "magic-sdk": "^29.1.0"
76
76
  },
77
77
  "peerDependenciesMeta": {
78
78
  "@blockshake/defly-connect": {