@txnlab/use-wallet-solid 4.3.1 → 4.4.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 +3 -3
- package/dist/dev.js +3 -3
- package/dist/dev.jsx +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/index.jsx +3 -3
- package/package.json +9 -9
package/dist/dev.cjs
CHANGED
|
@@ -771,7 +771,7 @@ exports.useWallet = () => {
|
|
|
771
771
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
772
772
|
const algodClient = solidStore.useStore(manager().store, (state) => state.algodClient);
|
|
773
773
|
const walletStore = solidStore.useStore(manager().store, (state) => state.wallets);
|
|
774
|
-
const walletState = (
|
|
774
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
775
775
|
const activeWalletId = solidStore.useStore(manager().store, (state) => state.activeWallet);
|
|
776
776
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
777
777
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -779,8 +779,8 @@ exports.useWallet = () => {
|
|
|
779
779
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
780
780
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
781
781
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
782
|
-
const isWalletActive = (
|
|
783
|
-
const isWalletConnected = (
|
|
782
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
783
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
784
784
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
785
785
|
const wallet = activeWallet();
|
|
786
786
|
if (!wallet) {
|
package/dist/dev.js
CHANGED
|
@@ -765,7 +765,7 @@ var useWallet = () => {
|
|
|
765
765
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
766
766
|
const algodClient = useStore(manager().store, (state) => state.algodClient);
|
|
767
767
|
const walletStore = useStore(manager().store, (state) => state.wallets);
|
|
768
|
-
const walletState = (
|
|
768
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
769
769
|
const activeWalletId = useStore(manager().store, (state) => state.activeWallet);
|
|
770
770
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
771
771
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -773,8 +773,8 @@ var useWallet = () => {
|
|
|
773
773
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
774
774
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
775
775
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
776
|
-
const isWalletActive = (
|
|
777
|
-
const isWalletConnected = (
|
|
776
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
777
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
778
778
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
779
779
|
const wallet = activeWallet();
|
|
780
780
|
if (!wallet) {
|
package/dist/dev.jsx
CHANGED
|
@@ -660,7 +660,7 @@ var useWallet = () => {
|
|
|
660
660
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
661
661
|
const algodClient = useStore(manager().store, (state) => state.algodClient);
|
|
662
662
|
const walletStore = useStore(manager().store, (state) => state.wallets);
|
|
663
|
-
const walletState = (
|
|
663
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
664
664
|
const activeWalletId = useStore(manager().store, (state) => state.activeWallet);
|
|
665
665
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
666
666
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -668,8 +668,8 @@ var useWallet = () => {
|
|
|
668
668
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
669
669
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
670
670
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
671
|
-
const isWalletActive = (
|
|
672
|
-
const isWalletConnected = (
|
|
671
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
672
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
673
673
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
674
674
|
const wallet = activeWallet();
|
|
675
675
|
if (!wallet) {
|
package/dist/index.cjs
CHANGED
|
@@ -766,7 +766,7 @@ exports.useWallet = () => {
|
|
|
766
766
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
767
767
|
const algodClient = solidStore.useStore(manager().store, (state) => state.algodClient);
|
|
768
768
|
const walletStore = solidStore.useStore(manager().store, (state) => state.wallets);
|
|
769
|
-
const walletState = (
|
|
769
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
770
770
|
const activeWalletId = solidStore.useStore(manager().store, (state) => state.activeWallet);
|
|
771
771
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
772
772
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -774,8 +774,8 @@ exports.useWallet = () => {
|
|
|
774
774
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
775
775
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
776
776
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
777
|
-
const isWalletActive = (
|
|
778
|
-
const isWalletConnected = (
|
|
777
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
778
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
779
779
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
780
780
|
const wallet = activeWallet();
|
|
781
781
|
if (!wallet) {
|
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,
|
|
2
|
+
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletKey, 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';
|
|
@@ -29,13 +29,13 @@ declare const useWallet: () => {
|
|
|
29
29
|
activeWalletState: () => WalletState | null;
|
|
30
30
|
activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
|
|
31
31
|
activeAddress: () => string | null;
|
|
32
|
-
activeWalletId: solid_js.Accessor<
|
|
33
|
-
isWalletActive: (
|
|
34
|
-
isWalletConnected: (
|
|
32
|
+
activeWalletId: solid_js.Accessor<WalletKey | null>;
|
|
33
|
+
isWalletActive: (walletKey: WalletKey) => boolean;
|
|
34
|
+
isWalletConnected: (walletKey: WalletKey) => boolean;
|
|
35
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<
|
|
38
|
+
walletStore: solid_js.Accessor<Partial<Record<WalletKey, WalletState>>>;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
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,
|
|
2
|
+
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletKey, 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';
|
|
@@ -29,13 +29,13 @@ declare const useWallet: () => {
|
|
|
29
29
|
activeWalletState: () => WalletState | null;
|
|
30
30
|
activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
|
|
31
31
|
activeAddress: () => string | null;
|
|
32
|
-
activeWalletId: solid_js.Accessor<
|
|
33
|
-
isWalletActive: (
|
|
34
|
-
isWalletConnected: (
|
|
32
|
+
activeWalletId: solid_js.Accessor<WalletKey | null>;
|
|
33
|
+
isWalletActive: (walletKey: WalletKey) => boolean;
|
|
34
|
+
isWalletConnected: (walletKey: WalletKey) => boolean;
|
|
35
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<
|
|
38
|
+
walletStore: solid_js.Accessor<Partial<Record<WalletKey, WalletState>>>;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export { WalletProvider, useNetwork, useWallet, useWalletManager };
|
package/dist/index.js
CHANGED
|
@@ -760,7 +760,7 @@ var useWallet = () => {
|
|
|
760
760
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
761
761
|
const algodClient = useStore(manager().store, (state) => state.algodClient);
|
|
762
762
|
const walletStore = useStore(manager().store, (state) => state.wallets);
|
|
763
|
-
const walletState = (
|
|
763
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
764
764
|
const activeWalletId = useStore(manager().store, (state) => state.activeWallet);
|
|
765
765
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
766
766
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -768,8 +768,8 @@ var useWallet = () => {
|
|
|
768
768
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
769
769
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
770
770
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
771
|
-
const isWalletActive = (
|
|
772
|
-
const isWalletConnected = (
|
|
771
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
772
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
773
773
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
774
774
|
const wallet = activeWallet();
|
|
775
775
|
if (!wallet) {
|
package/dist/index.jsx
CHANGED
|
@@ -655,7 +655,7 @@ var useWallet = () => {
|
|
|
655
655
|
const isReady = createMemo(() => managerStatus() === "ready");
|
|
656
656
|
const algodClient = useStore(manager().store, (state) => state.algodClient);
|
|
657
657
|
const walletStore = useStore(manager().store, (state) => state.wallets);
|
|
658
|
-
const walletState = (
|
|
658
|
+
const walletState = (walletKey) => walletStore()[walletKey] || null;
|
|
659
659
|
const activeWalletId = useStore(manager().store, (state) => state.activeWallet);
|
|
660
660
|
const activeWallet = () => manager().getWallet(activeWalletId()) || null;
|
|
661
661
|
const activeWalletState = () => walletState(activeWalletId());
|
|
@@ -663,8 +663,8 @@ var useWallet = () => {
|
|
|
663
663
|
const activeWalletAddresses = () => activeWalletAccounts()?.map((account) => account.address) ?? null;
|
|
664
664
|
const activeAccount = () => activeWalletState()?.activeAccount ?? null;
|
|
665
665
|
const activeAddress = () => activeAccount()?.address ?? null;
|
|
666
|
-
const isWalletActive = (
|
|
667
|
-
const isWalletConnected = (
|
|
666
|
+
const isWalletActive = (walletKey) => walletKey === activeWalletId();
|
|
667
|
+
const isWalletConnected = (walletKey) => !!walletState(walletKey)?.accounts.length || false;
|
|
668
668
|
const signTransactions = (txnGroup, indexesToSign) => {
|
|
669
669
|
const wallet = activeWallet();
|
|
670
670
|
if (!wallet) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txnlab/use-wallet-solid",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.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,25 +53,25 @@
|
|
|
53
53
|
"dist"
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@tanstack/solid-store": "0.
|
|
57
|
-
"@txnlab/use-wallet": "4.
|
|
56
|
+
"@tanstack/solid-store": "0.8.0",
|
|
57
|
+
"@txnlab/use-wallet": "4.4.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@solidjs/testing-library": "0.8.10",
|
|
61
|
-
"algosdk": "3.
|
|
62
|
-
"solid-js": "1.9.
|
|
63
|
-
"tsup": "8.5.
|
|
61
|
+
"algosdk": "3.5.2",
|
|
62
|
+
"solid-js": "1.9.10",
|
|
63
|
+
"tsup": "8.5.1",
|
|
64
64
|
"tsup-preset-solid": "2.2.0",
|
|
65
|
-
"typescript": "5.
|
|
65
|
+
"typescript": "5.9.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@blockshake/defly-connect": "^1.2.1",
|
|
69
69
|
"@magic-ext/algorand": "^24.4.2",
|
|
70
70
|
"@perawallet/connect": "^1.4.1",
|
|
71
71
|
"@walletconnect/modal": "^2.7.0",
|
|
72
|
-
"@walletconnect/sign-client": "^2.
|
|
72
|
+
"@walletconnect/sign-client": "^2.23.1",
|
|
73
73
|
"algosdk": "^3.0.0",
|
|
74
|
-
"lute-connect": "^1.6.
|
|
74
|
+
"lute-connect": "^1.6.3",
|
|
75
75
|
"magic-sdk": "^29.4.2"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|