fare-privy-core 1.7.5 → 1.7.7
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 +2 -2
- package/dist/hooks/useActiveWallet.d.ts +2 -4
- package/dist/hooks/useActiveWallet.d.ts.map +1 -1
- package/dist/hooks/useActiveWallet.js +7 -25
- package/dist/hooks/useActiveWallet.js.map +1 -1
- package/dist/hooks/useWalletBalance.d.ts +7 -24
- package/dist/hooks/useWalletBalance.d.ts.map +1 -1
- package/dist/hooks/useWalletBalance.js +67 -104
- package/dist/hooks/useWalletBalance.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A lightweight React library for Privy authentication and wallet management, designed for casino and gaming applications on **Ethereum and Solana**.
|
|
4
4
|
|
|
5
|
-
## 🚀 Current Features (v1.7.
|
|
5
|
+
## 🚀 Current Features (v1.7.7)
|
|
6
6
|
|
|
7
7
|
- **🔐 Real Privy Auth**: Full Privy authentication integration with login/logout
|
|
8
8
|
- **🎰 Casino-Ready**: Pre-configured for casino/gaming use cases
|
|
@@ -323,7 +323,7 @@ function WalletBalanceDisplay() {
|
|
|
323
323
|
|
|
324
324
|
## 📝 Changelog
|
|
325
325
|
|
|
326
|
-
### v1.7.
|
|
326
|
+
### v1.7.6 (Latest) - Reliable Patterns & Simplified Balance
|
|
327
327
|
- **🎯 Added**: useActiveWallet hook based on proven working casino patterns
|
|
328
328
|
- **💰 Simplified**: useWalletBalance rewritten with reliable single-wallet approach
|
|
329
329
|
- **🔧 Fixed**: Removed complex wallet filtering in favor of simple active wallet selection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useActiveWallet - Active wallet management
|
|
2
|
+
* useActiveWallet - Active wallet management (previous stable version)
|
|
3
3
|
* Based on the working pattern from your casino app
|
|
4
4
|
*/
|
|
5
5
|
import { type ConnectedWallet } from "@privy-io/react-auth";
|
|
@@ -8,14 +8,12 @@ export interface IActiveWallet extends ConnectedWallet {
|
|
|
8
8
|
getSolanaProvider?: () => Promise<any>;
|
|
9
9
|
}
|
|
10
10
|
export declare const useActiveWallet: () => {
|
|
11
|
-
privyWallet: ConnectedWallet;
|
|
12
|
-
externalWallet: ConnectedWallet;
|
|
13
11
|
activeWallet: IActiveWallet;
|
|
14
12
|
isWalletAuthed: boolean;
|
|
15
13
|
walletAddress: string;
|
|
16
14
|
ready: boolean;
|
|
17
15
|
authenticated: boolean;
|
|
18
16
|
readyAndAuth: boolean;
|
|
19
|
-
|
|
17
|
+
wallets: ConnectedWallet[];
|
|
20
18
|
};
|
|
21
19
|
//# sourceMappingURL=useActiveWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveWallet.d.ts","sourceRoot":"","sources":["../../hooks/useActiveWallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,mBAAmB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"useActiveWallet.d.ts","sourceRoot":"","sources":["../../hooks/useActiveWallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,aAAc,SAAQ,eAAe;IACpD,mBAAmB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CACxC;AAED,eAAO,MAAM,eAAe;;;;;;;;CA4C3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* useActiveWallet - Active wallet management
|
|
2
|
+
* useActiveWallet - Active wallet management (previous stable version)
|
|
3
3
|
* Based on the working pattern from your casino app
|
|
4
4
|
*/
|
|
5
5
|
import { useMemo } from "react";
|
|
@@ -8,49 +8,31 @@ export const useActiveWallet = () => {
|
|
|
8
8
|
const { ready, authenticated } = usePrivy();
|
|
9
9
|
const { wallets: unlinkedWallets } = useWallets();
|
|
10
10
|
const wallets = useMemo(() => unlinkedWallets.filter((wallet) => wallet.linked), [unlinkedWallets]);
|
|
11
|
-
|
|
12
|
-
const privyWallet = useMemo(() => {
|
|
13
|
-
if (!ready || !authenticated)
|
|
14
|
-
return null;
|
|
15
|
-
const wallet = linkedWallets.find((wallet) => wallet.connectorType === "embedded");
|
|
16
|
-
return wallet || null;
|
|
17
|
-
}, [linkedWallets, ready, authenticated]);
|
|
18
|
-
const externalWallet = useMemo(() => {
|
|
19
|
-
if (!ready || !authenticated)
|
|
20
|
-
return null;
|
|
21
|
-
const wallet = linkedWallets.find((wallet) => wallet.connectorType !== "embedded");
|
|
22
|
-
return wallet || null;
|
|
23
|
-
}, [linkedWallets, ready, authenticated]);
|
|
11
|
+
// Previous stable pattern: select first linked wallet as active
|
|
24
12
|
const activeWallet = useMemo(() => {
|
|
25
|
-
if (!ready || !authenticated)
|
|
13
|
+
if (!ready || !authenticated || wallets.length === 0)
|
|
26
14
|
return null;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return selectedWallet;
|
|
30
|
-
}, [linkedWallets, ready, authenticated, externalWallet, privyWallet]);
|
|
15
|
+
return wallets[0];
|
|
16
|
+
}, [ready, authenticated, wallets]);
|
|
31
17
|
const walletAddress = useMemo(() => activeWallet?.address || "", [activeWallet]);
|
|
32
18
|
const isWalletAuthed = useMemo(() => Boolean(activeWallet), [activeWallet]);
|
|
33
19
|
const readyAndAuth = useMemo(() => ready && authenticated, [ready, authenticated]);
|
|
34
20
|
return useMemo(() => ({
|
|
35
|
-
privyWallet,
|
|
36
|
-
externalWallet,
|
|
37
21
|
activeWallet,
|
|
38
22
|
isWalletAuthed,
|
|
39
23
|
walletAddress,
|
|
40
24
|
ready,
|
|
41
25
|
authenticated,
|
|
42
26
|
readyAndAuth,
|
|
43
|
-
|
|
27
|
+
wallets,
|
|
44
28
|
}), [
|
|
45
|
-
privyWallet,
|
|
46
|
-
externalWallet,
|
|
47
29
|
activeWallet,
|
|
48
30
|
isWalletAuthed,
|
|
49
31
|
walletAddress,
|
|
50
32
|
ready,
|
|
51
33
|
authenticated,
|
|
52
34
|
readyAndAuth,
|
|
53
|
-
|
|
35
|
+
wallets,
|
|
54
36
|
]);
|
|
55
37
|
};
|
|
56
38
|
//# sourceMappingURL=useActiveWallet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveWallet.js","sourceRoot":"","sources":["../../hooks/useActiveWallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,QAAQ,EACR,UAAU,GAEX,MAAM,sBAAsB,CAAC;AAO9B,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC5C,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,CAAC;IAClD,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EACvD,CAAC,eAAe,CAAC,CAClB,CAAC;IAEF,
|
|
1
|
+
{"version":3,"file":"useActiveWallet.js","sourceRoot":"","sources":["../../hooks/useActiveWallet.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,C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;QACb,KAAK;QACL,aAAa;QACb,YAAY;QACZ,OAAO;KACR,CACF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
import { type ConnectedWallet } from "@privy-io/react-auth";
|
|
6
|
-
export interface IWalletWithProvider extends ConnectedWallet {
|
|
7
|
-
getEthereumProvider: () => Promise<any>;
|
|
8
|
-
getSolanaProvider?: () => Promise<any>;
|
|
9
|
-
}
|
|
10
|
-
export declare const useWalletBalance: () => {
|
|
11
|
-
/** Ethereum balance in ETH (formatted to 6 decimals) */
|
|
12
|
-
ethereumBalance: string;
|
|
13
|
-
/** Solana balance in SOL (formatted to 6 decimals) */
|
|
14
|
-
solanaBalance: string;
|
|
15
|
-
/** Whether balance fetch is in progress */
|
|
1
|
+
export interface WalletBalance {
|
|
2
|
+
ethereumBalance: string | null;
|
|
3
|
+
solanaBalance: string | null;
|
|
16
4
|
loading: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/** Whether any balances are available */
|
|
22
|
-
hasBalances: boolean;
|
|
23
|
-
/** Active wallet being used for balance fetching */
|
|
24
|
-
activeWallet: IWalletWithProvider;
|
|
25
|
-
};
|
|
5
|
+
error: string | null;
|
|
6
|
+
refetchBalance: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useWalletBalance(): WalletBalance;
|
|
26
9
|
//# sourceMappingURL=useWalletBalance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWalletBalance.d.ts","sourceRoot":"","sources":["../../hooks/useWalletBalance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useWalletBalance.d.ts","sourceRoot":"","sources":["../../hooks/useWalletBalance.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CA8EhD"}
|
|
@@ -1,117 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
solana: null,
|
|
14
|
-
loading: false,
|
|
15
|
-
error: null,
|
|
16
|
-
});
|
|
17
|
-
// Get active wallet (similar to your useActiveWallet pattern)
|
|
18
|
-
const activeWallet = useMemo(() => {
|
|
19
|
-
if (!ready || !authenticated || wallets.length === 0)
|
|
20
|
-
return null;
|
|
21
|
-
return wallets[0]; // Use first linked wallet
|
|
22
|
-
}, [ready, authenticated, wallets]);
|
|
23
|
-
const fetchEthereumBalance = async (wallet) => {
|
|
24
|
-
try {
|
|
25
|
-
const provider = await wallet.getEthereumProvider();
|
|
26
|
-
if (!provider)
|
|
27
|
-
throw new Error("No Ethereum provider available");
|
|
28
|
-
const balanceHex = await provider.request({
|
|
29
|
-
method: "eth_getBalance",
|
|
30
|
-
params: [wallet.address, "latest"],
|
|
31
|
-
});
|
|
32
|
-
const balanceInWei = BigInt(balanceHex);
|
|
33
|
-
const balanceInEth = Number(balanceInWei) / 1e18;
|
|
34
|
-
return balanceInEth.toFixed(6);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
console.error("Error fetching Ethereum balance:", error);
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const fetchSolanaBalance = async (wallet) => {
|
|
42
|
-
try {
|
|
43
|
-
if (!wallet.getSolanaProvider) {
|
|
44
|
-
throw new Error("Wallet doesn't support Solana");
|
|
45
|
-
}
|
|
46
|
-
const provider = await wallet.getSolanaProvider();
|
|
47
|
-
if (!provider)
|
|
48
|
-
throw new Error("No Solana provider available");
|
|
49
|
-
const response = await provider.request({
|
|
50
|
-
method: "getBalance",
|
|
51
|
-
params: [wallet.address],
|
|
52
|
-
});
|
|
53
|
-
const balanceInLamports = response;
|
|
54
|
-
const balanceInSol = balanceInLamports / 1e9;
|
|
55
|
-
return balanceInSol.toFixed(6);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
console.error("Error fetching Solana balance:", error);
|
|
59
|
-
throw error;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const refreshBalances = async () => {
|
|
63
|
-
if (!activeWallet)
|
|
1
|
+
// ...existing code from previous stable version (single implementation only)...
|
|
2
|
+
import { useState, useEffect, useCallback, useRef } from "react";
|
|
3
|
+
import { useActiveWallet } from "./useActiveWallet";
|
|
4
|
+
export function useWalletBalance() {
|
|
5
|
+
const { activeWallet } = useActiveWallet();
|
|
6
|
+
const [ethereumBalance, setEthereumBalance] = useState(null);
|
|
7
|
+
const [solanaBalance, setSolanaBalance] = useState(null);
|
|
8
|
+
const [loading, setLoading] = useState(false);
|
|
9
|
+
const [error, setError] = useState(null);
|
|
10
|
+
const fetchingRef = useRef(false);
|
|
11
|
+
const fetchBalances = useCallback(async () => {
|
|
12
|
+
if (!activeWallet || fetchingRef.current) {
|
|
64
13
|
return;
|
|
65
|
-
|
|
14
|
+
}
|
|
15
|
+
fetchingRef.current = true;
|
|
16
|
+
setLoading(true);
|
|
17
|
+
setError(null);
|
|
66
18
|
try {
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
19
|
+
// For Ethereum wallets, try to get balance
|
|
20
|
+
if (activeWallet.address && activeWallet.getEthereumProvider) {
|
|
21
|
+
try {
|
|
22
|
+
// Try to get provider and fetch balance
|
|
23
|
+
const provider = await activeWallet.getEthereumProvider();
|
|
24
|
+
if (provider && provider.request) {
|
|
25
|
+
const balance = await provider.request({
|
|
26
|
+
method: "eth_getBalance",
|
|
27
|
+
params: [activeWallet.address, "latest"],
|
|
28
|
+
});
|
|
29
|
+
// Convert from hex wei to ETH
|
|
30
|
+
const balanceInWei = parseInt(balance, 16);
|
|
31
|
+
const balanceInEth = (balanceInWei / Math.pow(10, 18)).toFixed(4);
|
|
32
|
+
setEthereumBalance(balanceInEth);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// If no provider available, set placeholder
|
|
36
|
+
setEthereumBalance("0.0000");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (providerError) {
|
|
40
|
+
console.log("Provider balance fetch failed, using placeholder:", providerError);
|
|
41
|
+
setEthereumBalance("0.0000");
|
|
42
|
+
}
|
|
74
43
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const solBalance = await fetchSolanaBalance(activeWallet);
|
|
78
|
-
setBalances((prev) => ({ ...prev, solana: solBalance }));
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
console.log("No Solana balance available");
|
|
44
|
+
else {
|
|
45
|
+
setEthereumBalance(null);
|
|
82
46
|
}
|
|
47
|
+
// Solana placeholder (Privy doesn't support Solana balances in React SDK yet)
|
|
48
|
+
setSolanaBalance("0.0000");
|
|
83
49
|
}
|
|
84
|
-
catch (
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
50
|
+
catch (fetchError) {
|
|
51
|
+
console.error("Error fetching wallet balance:", fetchError);
|
|
52
|
+
setError("Failed to fetch balance");
|
|
53
|
+
setEthereumBalance(null);
|
|
54
|
+
setSolanaBalance(null);
|
|
89
55
|
}
|
|
90
56
|
finally {
|
|
91
|
-
|
|
57
|
+
setLoading(false);
|
|
58
|
+
fetchingRef.current = false;
|
|
92
59
|
}
|
|
93
|
-
};
|
|
94
|
-
//
|
|
60
|
+
}, [activeWallet?.address]);
|
|
61
|
+
// Reset balances when wallet changes
|
|
95
62
|
useEffect(() => {
|
|
96
|
-
if (activeWallet) {
|
|
97
|
-
|
|
63
|
+
if (activeWallet?.address) {
|
|
64
|
+
fetchBalances();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
setEthereumBalance(null);
|
|
68
|
+
setSolanaBalance(null);
|
|
69
|
+
setError(null);
|
|
98
70
|
}
|
|
99
|
-
}, [activeWallet]);
|
|
71
|
+
}, [activeWallet?.address, fetchBalances]); // Include fetchBalances since it's stable with useCallback
|
|
100
72
|
return {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
loading: balances.loading,
|
|
107
|
-
/** Error message if balance fetch failed */
|
|
108
|
-
error: balances.error,
|
|
109
|
-
/** Manually refresh balances */
|
|
110
|
-
refreshBalances,
|
|
111
|
-
/** Whether any balances are available */
|
|
112
|
-
hasBalances: !!(balances.ethereum || balances.solana),
|
|
113
|
-
/** Active wallet being used for balance fetching */
|
|
114
|
-
activeWallet,
|
|
73
|
+
ethereumBalance,
|
|
74
|
+
solanaBalance,
|
|
75
|
+
loading,
|
|
76
|
+
error,
|
|
77
|
+
refetchBalance: fetchBalances,
|
|
115
78
|
};
|
|
116
|
-
}
|
|
79
|
+
}
|
|
117
80
|
//# sourceMappingURL=useWalletBalance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWalletBalance.js","sourceRoot":"","sources":["../../hooks/useWalletBalance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useWalletBalance.js","sourceRoot":"","sources":["../../hooks/useWalletBalance.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUpD,MAAM,UAAU,gBAAgB;IAC9B,M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AAa,CAAC,CAAC,CAAC,CAAC,2DAA2D;IAEvG,OAAO;QACL,eAAe;QACf,aAAa;QACb,OAAO;QACP,KAAK;QACL,cAAc,EAAE,aAAa;KAC9B,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
2
|
+
npm * fare-privy-core - v1.7.6 - Reliable Micro Hooks
|
|
3
3
|
* Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
|
|
4
4
|
*/
|
|
5
5
|
export { PrivyProvider, type PrivyProviderProps, createSolanaConnectors, disableSolanaConnectors, } from "./PrivyProviderTest";
|
|
6
6
|
export * from "./farePrivy/store/switchWallet";
|
|
7
7
|
export { useConnectedWallets, useActiveWallet, useWalletAddresses, useIsAuthenticated, useAuthActions, useWalletBalance, } from "./hooks/index";
|
|
8
8
|
/**
|
|
9
|
-
* ✅ PRODUCTION READY - v1.7.
|
|
9
|
+
* ✅ PRODUCTION READY - v1.7.6:
|
|
10
10
|
*
|
|
11
11
|
* ✅ Dependencies: Tightened version constraints for stability
|
|
12
12
|
* ✅ Build System: TypeScript compilation working flawlessly
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
2
|
+
npm * fare-privy-core - v1.7.6 - Reliable Micro Hooks
|
|
3
3
|
* Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
|
|
4
4
|
*/
|
|
5
5
|
// ✅ CURRENT EXPORTS - Available Now
|
|
@@ -11,7 +11,7 @@ export { useConnectedWallets, useActiveWallet, useWalletAddresses, useIsAuthenti
|
|
|
11
11
|
// ❌ REMOVED - Had too many external dependencies
|
|
12
12
|
// export * from "./farePrivy/modals/index.js";
|
|
13
13
|
/**
|
|
14
|
-
* ✅ PRODUCTION READY - v1.7.
|
|
14
|
+
* ✅ PRODUCTION READY - v1.7.6:
|
|
15
15
|
*
|
|
16
16
|
* ✅ Dependencies: Tightened version constraints for stability
|
|
17
17
|
* ✅ Build System: TypeScript compilation working flawlessly
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fare-privy-core",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
4
4
|
"description": "A comprehensive React library for Privy authentication and wallet management with casino gaming features, featuring reliable micro-hooks based on proven patterns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"privy",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@privy-io/react-auth": "^1.0.0",
|
|
77
77
|
"framer-motion": ">=6.0.0",
|
|
78
|
-
"react": "^18.
|
|
79
|
-
"react-dom": "^18.
|
|
78
|
+
"react": "^18.3.1",
|
|
79
|
+
"react-dom": "^18.3.1",
|
|
80
80
|
"styled-components": ">=5.0.0 <6.0.0",
|
|
81
81
|
"valtio": ">=1.0.0 <2.0.0"
|
|
82
82
|
},
|