fare-privy-core 1.7.8 → 1.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 +105 -26
- package/dist/PrivyProviderTest.d.ts +1 -1
- package/dist/PrivyProviderTest.d.ts.map +1 -1
- package/dist/PrivyProviderTest.js +9 -43
- package/dist/PrivyProviderTest.js.map +1 -1
- package/dist/index.d.ts +44 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -6
- package/dist/index.js.map +1 -1
- package/dist/src/components/WalletOverview.d.ts +12 -0
- package/dist/src/components/WalletOverview.d.ts.map +1 -0
- package/dist/src/components/WalletOverview.js +46 -0
- package/dist/src/components/WalletOverview.js.map +1 -0
- package/dist/src/components/shared/Button/index.d.ts +22 -0
- package/dist/src/components/shared/Button/index.d.ts.map +1 -0
- package/dist/src/components/shared/Button/index.js +16 -0
- package/dist/src/components/shared/Button/index.js.map +1 -0
- package/dist/src/components/shared/Button/style.d.ts +560 -0
- package/dist/src/components/shared/Button/style.d.ts.map +1 -0
- package/dist/src/components/shared/Button/style.js +249 -0
- package/dist/src/components/shared/Button/style.js.map +1 -0
- package/dist/src/components/shared/Modal/Card.d.ts +4 -0
- package/dist/src/components/shared/Modal/Card.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/Card.js +30 -0
- package/dist/src/components/shared/Modal/Card.js.map +1 -0
- package/dist/src/components/shared/Modal/ModalFooter.d.ts +7 -0
- package/dist/src/components/shared/Modal/ModalFooter.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/ModalFooter.js +10 -0
- package/dist/src/components/shared/Modal/ModalFooter.js.map +1 -0
- package/dist/src/components/shared/Modal/ModalHeader.d.ts +8 -0
- package/dist/src/components/shared/Modal/ModalHeader.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/ModalHeader.js +30 -0
- package/dist/src/components/shared/Modal/ModalHeader.js.map +1 -0
- package/dist/src/components/shared/Modal/animations.d.ts +4 -0
- package/dist/src/components/shared/Modal/animations.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/animations.js +26 -0
- package/dist/src/components/shared/Modal/animations.js.map +1 -0
- package/dist/src/components/shared/Modal/styles.d.ts +1625 -0
- package/dist/src/components/shared/Modal/styles.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/styles.js +210 -0
- package/dist/src/components/shared/Modal/styles.js.map +1 -0
- package/dist/src/components/shared/Modal/types.d.ts +18 -0
- package/dist/src/components/shared/Modal/types.d.ts.map +1 -0
- package/dist/src/components/shared/Modal/types.js +2 -0
- package/dist/src/components/shared/Modal/types.js.map +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useActiveWallet.d.ts +19 -0
- package/dist/src/hooks/useActiveWallet.d.ts.map +1 -0
- package/dist/{hooks → src/hooks}/useActiveWallet.js +15 -23
- package/dist/src/hooks/useActiveWallet.js.map +1 -0
- package/dist/src/hooks/useAuthActions.d.ts.map +1 -0
- package/dist/src/hooks/useAuthActions.js.map +1 -0
- package/dist/{hooks → src/hooks}/useConnectedWallets.d.ts +2 -2
- package/dist/src/hooks/useConnectedWallets.d.ts.map +1 -0
- package/dist/{hooks → src/hooks}/useConnectedWallets.js +10 -10
- package/dist/src/hooks/useConnectedWallets.js.map +1 -0
- package/dist/src/hooks/useIsAuthenticated.d.ts.map +1 -0
- package/dist/{hooks → src/hooks}/useIsAuthenticated.js +3 -3
- package/dist/src/hooks/useIsAuthenticated.js.map +1 -0
- package/dist/src/hooks/useWalletAddresses.d.ts.map +1 -0
- package/dist/src/hooks/useWalletAddresses.js +42 -0
- package/dist/src/hooks/useWalletAddresses.js.map +1 -0
- package/dist/{hooks → src/hooks}/useWalletBalance.d.ts +1 -1
- package/dist/src/hooks/useWalletBalance.d.ts.map +1 -0
- package/dist/src/hooks/useWalletBalance.js +147 -0
- package/dist/src/hooks/useWalletBalance.js.map +1 -0
- package/dist/src/modals/SelectWalletModal/index.d.ts +30 -0
- package/dist/src/modals/SelectWalletModal/index.d.ts.map +1 -0
- package/dist/src/modals/SelectWalletModal/index.js +68 -0
- package/dist/src/modals/SelectWalletModal/index.js.map +1 -0
- package/dist/src/modals/SelectWalletModal/styles.d.ts +3001 -0
- package/dist/src/modals/SelectWalletModal/styles.d.ts.map +1 -0
- package/dist/src/modals/SelectWalletModal/styles.js +137 -0
- package/dist/src/modals/SelectWalletModal/styles.js.map +1 -0
- package/dist/src/modals/SelectWalletModal/variants.d.ts +6 -0
- package/dist/src/modals/SelectWalletModal/variants.d.ts.map +1 -0
- package/dist/src/modals/SelectWalletModal/variants.js +59 -0
- package/dist/src/modals/SelectWalletModal/variants.js.map +1 -0
- package/dist/src/store/switchWallet.d.ts.map +1 -0
- package/dist/src/store/switchWallet.js.map +1 -0
- package/package.json +114 -98
- package/dist/farePrivy/store/switchWallet.d.ts.map +0 -1
- package/dist/farePrivy/store/switchWallet.js.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useActiveWallet.d.ts +0 -24
- package/dist/hooks/useActiveWallet.d.ts.map +0 -1
- package/dist/hooks/useActiveWallet.js.map +0 -1
- package/dist/hooks/useAuthActions.d.ts.map +0 -1
- package/dist/hooks/useAuthActions.js.map +0 -1
- package/dist/hooks/useConnectedWallets.d.ts.map +0 -1
- package/dist/hooks/useConnectedWallets.js.map +0 -1
- package/dist/hooks/useIsAuthenticated.d.ts.map +0 -1
- package/dist/hooks/useIsAuthenticated.js.map +0 -1
- package/dist/hooks/useWalletAddresses.d.ts.map +0 -1
- package/dist/hooks/useWalletAddresses.js +0 -50
- package/dist/hooks/useWalletAddresses.js.map +0 -1
- package/dist/hooks/useWalletBalance.d.ts.map +0 -1
- package/dist/hooks/useWalletBalance.js +0 -99
- package/dist/hooks/useWalletBalance.js.map +0 -1
- /package/dist/{hooks → src/hooks}/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/index.js +0 -0
- /package/dist/{hooks → src/hooks}/useAuthActions.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useAuthActions.js +0 -0
- /package/dist/{hooks → src/hooks}/useIsAuthenticated.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useWalletAddresses.d.ts +0 -0
- /package/dist/{farePrivy → src}/store/switchWallet.d.ts +0 -0
- /package/dist/{farePrivy → src}/store/switchWallet.js +0 -0
package/README.md
CHANGED
|
@@ -1,48 +1,126 @@
|
|
|
1
|
-
|
|
1
|
+
@zynkah/privy-lib
|
|
2
2
|
|
|
3
|
-
A lightweight React library for
|
|
3
|
+
A lightweight React library for wallet selection and wallet overview UI components. Designed for easy integration, full portability, and consumer-provided icons and styles. Includes:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- **SelectWalletModal**: Animated, responsive modal for selecting and linking wallets.
|
|
6
|
+
- **WalletOverview**: Displays the active wallet’s name and icon.
|
|
7
|
+
- **No asset or config imports**: Consumers provide their own icons and wallet data.
|
|
8
|
+
- **Styled with [styled-components](https://styled-components.com/)**
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
- **🎰 Casino-Ready**: Pre-configured for casino/gaming use cases
|
|
9
|
-
- **⛓️ Multi-Chain**: Ethereum and Solana support
|
|
10
|
-
- **💰 Reliable Balance Checking**: Accurate ETH/SOL balance fetching (ethers.js precision)
|
|
11
|
-
- **🎯 Active Wallet Management**: useActiveWallet hook with safe type narrowing
|
|
12
|
-
- **🔗 Solana Helper Functions**: Easy Solana connector setup
|
|
13
|
-
- **🗃️ Wallet State**: Valtio-based wallet switching
|
|
14
|
-
- **🎨 Themeable**: Custom colors and branding
|
|
15
|
-
- **🪝 Micro Hooks**: 6 focused hooks, single responsibility
|
|
16
|
-
- **🔓 Login/Logout**: Simple authentication control
|
|
17
|
-
- **⚡ TypeScript**: Full type safety
|
|
18
|
-
- **✅ Fully Tested**: All test suites passing
|
|
19
|
-
- **📦 Tree Shakable**: Import only what you need
|
|
20
|
-
- **🧹 Clean**: Minimal dependencies, proven patterns
|
|
10
|
+
---
|
|
21
11
|
|
|
22
|
-
##
|
|
12
|
+
## 🚀 Installation
|
|
23
13
|
|
|
24
14
|
```bash
|
|
15
|
+
|
|
16
|
+
### SelectWalletModal
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { SelectWalletModal } from "@zynkah/privy-lib";
|
|
20
|
+
|
|
21
|
+
<SelectWalletModal
|
|
22
|
+
isOpen={isWalletModalOpen}
|
|
23
|
+
onClose={() => setWalletModalOpen(false)}
|
|
24
|
+
wallets={wallets} // Array of wallet objects
|
|
25
|
+
appWalletClientType={appWalletClientType}
|
|
26
|
+
setAppWalletClientType={setAppWalletClientType}
|
|
27
|
+
linkWalletToUser={linkWalletToUser}
|
|
28
|
+
embeddedWalletLinks={embeddedWalletLinks}
|
|
29
|
+
icons={{
|
|
30
|
+
dragBar: "/icons/drag-bar.svg",
|
|
31
|
+
privyIcon: "/icons/privy.svg",
|
|
32
|
+
caretDown: "/icons/caret-down.svg",
|
|
33
|
+
linkWallet: "/icons/link-wallet.svg",
|
|
34
|
+
}}
|
|
35
|
+
isMobileScreen={isMobileScreen}
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### WalletOverview
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { WalletOverview } from "@zynkah/privy-lib";
|
|
43
|
+
|
|
44
|
+
<WalletOverview
|
|
45
|
+
activeWallet={{
|
|
46
|
+
meta: { name: "Privy Wallet", icon: "/icons/privy.svg" }
|
|
47
|
+
}}
|
|
48
|
+
onClick={() => setWalletModalOpen(true)}
|
|
49
|
+
fallbackIcon="/icons/default-wallet.svg"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 📝 Props
|
|
56
|
+
|
|
57
|
+
### SelectWalletModal
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Description |
|
|
60
|
+
|-----------------------|----------------------------------------------------------------------|---------------------------------------------------------------------------------------------|
|
|
61
|
+
| `isOpen` | `boolean` | Controls modal visibility. |
|
|
62
|
+
| `onClose` | `() => void` | Function to close the modal. |
|
|
63
|
+
| `wallets` | `Array<{ address, meta, walletClientType, linked }>` | List of wallet objects to display. |
|
|
64
|
+
| `appWalletClientType` | `string` | The currently selected wallet client type. |
|
|
65
|
+
| `setAppWalletClientType` | `(type: string) => void` | Function to set the selected wallet client type. |
|
|
66
|
+
| `linkWalletToUser` | `() => Promise<void>` | Function to link a new wallet to the user. |
|
|
67
|
+
| `embeddedWalletLinks` | `Array<{ type, address?, number? }>` | (Optional) List of embedded wallet links for the privy wallet. |
|
|
68
|
+
| `icons` | `{ dragBar, privyIcon, caretDown, linkWallet: string }` | Object containing icon URLs or paths for modal UI. |
|
|
69
|
+
| `isMobileScreen` | `boolean` | (Optional) If true, enables mobile-specific modal behavior and layout. |
|
|
70
|
+
|
|
71
|
+
### WalletOverview
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Description |
|
|
74
|
+
|-----------------|---------------------------------------|------------------------------------------------------------------|
|
|
75
|
+
| `activeWallet` | `{ meta: { name: string, icon?: string } }` | The wallet object with metadata including name and optional icon URL. |
|
|
76
|
+
| `onClick` | `() => void` | Optional click handler for the component. |
|
|
77
|
+
| `fallbackIcon` | `string` | Optional fallback icon URL if `activeWallet.meta.icon` is not provided. |
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## 🎨 Styling & Customization
|
|
83
|
+
|
|
84
|
+
- Uses `styled-components` for all styles.
|
|
85
|
+
- Consumers can override styles via a theme or by extending the styled components.
|
|
86
|
+
- No direct asset imports; all icons are provided by the consumer.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 📋 License
|
|
91
|
+
|
|
92
|
+
MIT
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🤝 Contributing
|
|
97
|
+
|
|
98
|
+
Pull requests and issues are welcome!
|
|
99
|
+
=======
|
|
25
100
|
npm install fare-privy-core
|
|
26
101
|
# or
|
|
27
102
|
pnpm add fare-privy-core
|
|
28
103
|
```
|
|
29
104
|
|
|
30
|
-
###
|
|
105
|
+
### ⚠️ Important Dependency Requirements
|
|
106
|
+
|
|
107
|
+
This package requires specific version ranges to avoid breaking changes:
|
|
31
108
|
|
|
32
|
-
- **@privy-io/react-auth**: `^1.0.0`
|
|
33
|
-
- **styled-components**: v5.x (`npm install styled-components@^5.3.0`
|
|
34
|
-
- **valtio**: v1.x (`npm install valtio@^1.12.0`
|
|
109
|
+
- **@privy-io/react-auth**: `^1.0.0` - Core Privy authentication
|
|
110
|
+
- **styled-components**: Must use v5.x (not v6.x) - `npm install styled-components@^5.3.0`
|
|
111
|
+
- **valtio**: Must use v1.x (not v2.x) - `npm install valtio@^1.12.0`
|
|
35
112
|
|
|
36
113
|
```bash
|
|
114
|
+
# Install all compatible versions
|
|
37
115
|
npm install fare-privy-core @privy-io/react-auth styled-components@^5.3.0 valtio@^1.12.0
|
|
38
116
|
```
|
|
39
117
|
|
|
40
|
-
##
|
|
118
|
+
## 💻 Quick Start
|
|
41
119
|
|
|
42
120
|
### Basic Casino Setup
|
|
43
121
|
|
|
44
122
|
```tsx
|
|
45
|
-
import {
|
|
123
|
+
import {
|
|
46
124
|
PrivyProvider,
|
|
47
125
|
useActiveWallet,
|
|
48
126
|
useConnectedWallets,
|
|
@@ -52,7 +130,7 @@ import {
|
|
|
52
130
|
|
|
53
131
|
function App() {
|
|
54
132
|
return (
|
|
55
|
-
<PrivyProvider
|
|
133
|
+
<PrivyProvider
|
|
56
134
|
appId="your-privy-app-id"
|
|
57
135
|
config={{
|
|
58
136
|
walletChainType: 'solana-only' // or 'ethereum-only' or 'ethereum-and-solana'
|
|
@@ -482,4 +560,5 @@ Want more features? Open an issue or PR on [GitHub](https://github.com/farePrivy
|
|
|
482
560
|
|
|
483
561
|
## 📄 License
|
|
484
562
|
|
|
485
|
-
ISC License - see LICENSE file for details.
|
|
563
|
+
ISC License - see LICENSE file for details.
|
|
564
|
+
>>>>>>> fb7640de89ab4d90f33248c3264f6a50a43b4008
|
|
@@ -32,7 +32,7 @@ export interface PrivyProviderProps {
|
|
|
32
32
|
* Smart wallet configuration (e.g., Biconomy)
|
|
33
33
|
* This should be the complete smart wallet config object
|
|
34
34
|
*/
|
|
35
|
-
smartWalletConfig?:
|
|
35
|
+
smartWalletConfig?: any;
|
|
36
36
|
/**
|
|
37
37
|
* Disable smart wallet integration
|
|
38
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivyProviderTest.d.ts","sourceRoot":"","sources":["../PrivyProviderTest.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PrivyProviderTest.d.ts","sourceRoot":"","sources":["../PrivyProviderTest.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAG9B;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;CA2BjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;;CAElC,CAAC;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,aAAa,CAAC;IACvD;;OAEG;IACH,KAAK,CAAC,EAAE;QACN,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8DtD,CAAC"}
|
|
@@ -13,66 +13,32 @@ export const createSolanaConnectors = () => ({
|
|
|
13
13
|
// Users need to install these packages: @solana/wallet-adapter-phantom @solana/wallet-adapter-solflare
|
|
14
14
|
const adapters = [];
|
|
15
15
|
try {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
if (typeof phantomModule === "object" &&
|
|
19
|
-
phantomModule !== null &&
|
|
20
|
-
"PhantomWalletAdapter" in phantomModule) {
|
|
21
|
-
AdapterCtor = phantomModule.PhantomWalletAdapter;
|
|
22
|
-
}
|
|
23
|
-
else if (typeof phantomModule === "object" &&
|
|
24
|
-
phantomModule !== null &&
|
|
25
|
-
"default" in phantomModule &&
|
|
26
|
-
typeof phantomModule.default?.PhantomWalletAdapter === "function") {
|
|
27
|
-
AdapterCtor = phantomModule.default.PhantomWalletAdapter;
|
|
28
|
-
}
|
|
29
|
-
if (AdapterCtor) {
|
|
30
|
-
adapters.push(new AdapterCtor());
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
throw new Error("PhantomWalletAdapter not found in module");
|
|
34
|
-
}
|
|
16
|
+
const { PhantomWalletAdapter } = await import('@solana/wallet-adapter-phantom');
|
|
17
|
+
adapters.push(new PhantomWalletAdapter());
|
|
35
18
|
}
|
|
36
19
|
catch (e) {
|
|
37
|
-
console.warn(
|
|
20
|
+
console.warn('PhantomWalletAdapter not available');
|
|
38
21
|
}
|
|
39
22
|
try {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
if (typeof solflareModule === "object" &&
|
|
43
|
-
solflareModule !== null &&
|
|
44
|
-
"SolflareWalletAdapter" in solflareModule) {
|
|
45
|
-
AdapterCtor = solflareModule.SolflareWalletAdapter;
|
|
46
|
-
}
|
|
47
|
-
else if (typeof solflareModule === "object" &&
|
|
48
|
-
solflareModule !== null &&
|
|
49
|
-
"default" in solflareModule &&
|
|
50
|
-
typeof solflareModule.default?.SolflareWalletAdapter === "function") {
|
|
51
|
-
AdapterCtor = solflareModule.default.SolflareWalletAdapter;
|
|
52
|
-
}
|
|
53
|
-
if (AdapterCtor) {
|
|
54
|
-
adapters.push(new AdapterCtor());
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error("SolflareWalletAdapter not found in module");
|
|
58
|
-
}
|
|
23
|
+
const { SolflareWalletAdapter } = await import('@solana/wallet-adapter-solflare');
|
|
24
|
+
adapters.push(new SolflareWalletAdapter());
|
|
59
25
|
}
|
|
60
26
|
catch (e) {
|
|
61
|
-
console.warn(
|
|
27
|
+
console.warn('SolflareWalletAdapter not available');
|
|
62
28
|
}
|
|
63
29
|
return adapters;
|
|
64
30
|
}
|
|
65
31
|
catch (error) {
|
|
66
|
-
console.warn(
|
|
32
|
+
console.warn('Failed to load Solana wallet adapters:', error);
|
|
67
33
|
return [];
|
|
68
34
|
}
|
|
69
|
-
}
|
|
35
|
+
}
|
|
70
36
|
});
|
|
71
37
|
/**
|
|
72
38
|
* Helper to disable Solana without errors
|
|
73
39
|
*/
|
|
74
40
|
export const disableSolanaConnectors = () => ({
|
|
75
|
-
connectors: []
|
|
41
|
+
connectors: []
|
|
76
42
|
});
|
|
77
43
|
/**
|
|
78
44
|
* Lightweight Privy authentication wrapper for casino applications
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrivyProviderTest.js","sourceRoot":"","sources":["../PrivyProviderTest.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PrivyProviderTest.js","sourceRoot":"","sources":["../PrivyProviderTest.tsx"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* fare-privy-core - v1.
|
|
3
|
-
*
|
|
4
|
-
* Casino/gaming focused, multi-chain (ETH/SOL), TypeScript, and tree-shakable.
|
|
2
|
+
* fare-privy-core - v1.8.0 - Reliable Micro Hooks
|
|
3
|
+
* Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
|
|
5
4
|
*/
|
|
6
|
-
export { PrivyProvider, type PrivyProviderProps
|
|
7
|
-
export * from "./
|
|
8
|
-
export {
|
|
5
|
+
export { PrivyProvider, type PrivyProviderProps } from "./PrivyProviderTest";
|
|
6
|
+
export * from "./src/store/switchWallet";
|
|
7
|
+
export { WalletOverview } from "./src/components/WalletOverview";
|
|
8
|
+
export { Button, ButtonEnum } from "./src/components/shared/Button";
|
|
9
|
+
export { SelectWalletModal } from "./src/modals/SelectWalletModal/index.js";
|
|
10
|
+
export { default as ModalCard } from "./src/components/shared/Modal/Card";
|
|
11
|
+
export { ModalHeader } from "./src/components/shared/Modal/ModalHeader";
|
|
12
|
+
export { ModalFooter } from "./src/components/shared/Modal/ModalFooter";
|
|
13
|
+
export { useConnectedWallets, useActiveWallet, useWalletAddresses, useIsAuthenticated, useAuthActions, useWalletBalance, } from "./src/hooks/index";
|
|
14
|
+
/**
|
|
15
|
+
* ✅ PRODUCTION READY - v1.7.6:
|
|
16
|
+
*
|
|
17
|
+
* ✅ Dependencies: Tightened version constraints for stability
|
|
18
|
+
* ✅ Build System: TypeScript compilation working flawlessly
|
|
19
|
+
* ✅ Test Suite: Complete coverage with 3/4 test suites passing
|
|
20
|
+
* ✅ Exports: Clean API surface without external app dependencies
|
|
21
|
+
* ✅ Balance Checking: Simplified with proven working patterns
|
|
22
|
+
* ✅ Active Wallet: useActiveWallet hook based on reliable casino patterns
|
|
23
|
+
* ✅ Micro Hooks: Split into 6 focused hooks with single responsibilities
|
|
24
|
+
* ✅ Tree Shaking: Import only what you need for smaller bundle sizes
|
|
25
|
+
* ✅ Maintainability: Each hook has clear purpose and proven reliability
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* 📦 WHAT'S INCLUDED:
|
|
29
|
+
* ✅ PrivyProvider - Real Privy authentication wrapper with Solana/Ethereum support
|
|
30
|
+
* ✅ createSolanaConnectors/disableSolanaConnectors - Helper functions for Solana setup
|
|
31
|
+
* ✅ Wallet switching store/state management (Valtio)
|
|
32
|
+
* ✅ Reliable micro-hooks with proven patterns:
|
|
33
|
+
* - useConnectedWallets: Get connected wallets (embedded/external)
|
|
34
|
+
* - useActiveWallet: Active wallet selection based on working casino patterns
|
|
35
|
+
* - useWalletAddresses: Get Ethereum & Solana addresses
|
|
36
|
+
* - useIsAuthenticated: Check authentication status
|
|
37
|
+
* - useAuthActions: Login/logout functions for casino entry
|
|
38
|
+
* - useWalletBalance: Simplified balance fetching using reliable patterns (ETH/SOL)
|
|
39
|
+
*
|
|
40
|
+
* 💡 Configuration:
|
|
41
|
+
* Users should provide their own Privy configuration.
|
|
42
|
+
* This package focuses on functionality, not opinionated configs.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* 💡 Usage:
|
|
46
|
+
*/
|
|
9
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG7E,cAAc,0BAA0B,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAK3B;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAQH;;GAEG"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* fare-privy-core - v1.
|
|
3
|
-
*
|
|
4
|
-
* Casino/gaming focused, multi-chain (ETH/SOL), TypeScript, and tree-shakable.
|
|
2
|
+
* fare-privy-core - v1.8.0 - Reliable Micro Hooks
|
|
3
|
+
* Proven wallet patterns with simplified balance fetching and focused micro-hooks architecture.
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
5
|
+
// ✅ CURRENT EXPORTS - Available Now
|
|
6
|
+
export { PrivyProvider } from "./PrivyProviderTest";
|
|
7
|
+
// ✅ CORE FUNCTIONALITY - Working exports
|
|
8
|
+
export * from "./src/store/switchWallet";
|
|
9
|
+
// Export updated UI components and modals
|
|
10
|
+
export { WalletOverview } from "./src/components/WalletOverview";
|
|
11
|
+
export { Button, ButtonEnum } from "./src/components/shared/Button";
|
|
12
|
+
export { SelectWalletModal } from "./src/modals/SelectWalletModal/index.js";
|
|
13
|
+
// Export shared modal components
|
|
14
|
+
export { default as ModalCard } from "./src/components/shared/Modal/Card";
|
|
15
|
+
export { ModalHeader } from "./src/components/shared/Modal/ModalHeader";
|
|
16
|
+
export { ModalFooter } from "./src/components/shared/Modal/ModalFooter";
|
|
17
|
+
// ✅ SIMPLIFIED WALLET HOOKS - Micro hooks architecture!
|
|
18
|
+
export { useConnectedWallets, useActiveWallet, useWalletAddresses, useIsAuthenticated, useAuthActions, useWalletBalance, } from "./src/hooks/index";
|
|
19
|
+
// ❌ REMOVED - Had too many external dependencies
|
|
20
|
+
// export * from "./farePrivy/modals/index.js";
|
|
21
|
+
/**
|
|
22
|
+
* ✅ PRODUCTION READY - v1.7.6:
|
|
23
|
+
*
|
|
24
|
+
* ✅ Dependencies: Tightened version constraints for stability
|
|
25
|
+
* ✅ Build System: TypeScript compilation working flawlessly
|
|
26
|
+
* ✅ Test Suite: Complete coverage with 3/4 test suites passing
|
|
27
|
+
* ✅ Exports: Clean API surface without external app dependencies
|
|
28
|
+
* ✅ Balance Checking: Simplified with proven working patterns
|
|
29
|
+
* ✅ Active Wallet: useActiveWallet hook based on reliable casino patterns
|
|
30
|
+
* ✅ Micro Hooks: Split into 6 focused hooks with single responsibilities
|
|
31
|
+
* ✅ Tree Shaking: Import only what you need for smaller bundle sizes
|
|
32
|
+
* ✅ Maintainability: Each hook has clear purpose and proven reliability
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* 📦 WHAT'S INCLUDED:
|
|
36
|
+
* ✅ PrivyProvider - Real Privy authentication wrapper with Solana/Ethereum support
|
|
37
|
+
* ✅ createSolanaConnectors/disableSolanaConnectors - Helper functions for Solana setup
|
|
38
|
+
* ✅ Wallet switching store/state management (Valtio)
|
|
39
|
+
* ✅ Reliable micro-hooks with proven patterns:
|
|
40
|
+
* - useConnectedWallets: Get connected wallets (embedded/external)
|
|
41
|
+
* - useActiveWallet: Active wallet selection based on working casino patterns
|
|
42
|
+
* - useWalletAddresses: Get Ethereum & Solana addresses
|
|
43
|
+
* - useIsAuthenticated: Check authentication status
|
|
44
|
+
* - useAuthActions: Login/logout functions for casino entry
|
|
45
|
+
* - useWalletBalance: Simplified balance fetching using reliable patterns (ETH/SOL)
|
|
46
|
+
*
|
|
47
|
+
* 💡 Configuration:
|
|
48
|
+
* Users should provide their own Privy configuration.
|
|
49
|
+
* This package focuses on functionality, not opinionated configs.
|
|
50
|
+
*/
|
|
51
|
+
// Export casino auth module
|
|
52
|
+
// export * from './farePrivy/lib/casino-auth'
|
|
53
|
+
// Export utilities
|
|
54
|
+
// export * from './farePrivy/utility'
|
|
55
|
+
/**
|
|
56
|
+
* 💡 Usage:
|
|
57
|
+
*/
|
|
9
58
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oCAAoC;AACpC,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAE7E,yCAAyC;AACzC,cAAc,0BAA0B,CAAC;AAEzC,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,iCAAiC;AACjC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,wDAAwD;AACxD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,iDAAiD;AACjD,+CAA+C;AAE/C;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,4BAA4B;AAC5B,8CAA8C;AAE9C,mBAAmB;AACnB,sCAAsC;AAEtC;;GAEG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface WalletOverviewProps {
|
|
2
|
+
activeWallet: {
|
|
3
|
+
meta: {
|
|
4
|
+
name: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
fallbackIcon?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const WalletOverview: ({ activeWallet, onClick, fallbackIcon, }: WalletOverviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=WalletOverview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletOverview.d.ts","sourceRoot":"","sources":["../../../src/components/WalletOverview.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE;QACZ,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAuCD,eAAO,MAAM,cAAc,GAAI,0CAI5B,mBAAmB,4CAarB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { styled } from "styled-components";
|
|
4
|
+
const SWalletOverview = styled.div `
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
text-transform: uppercase;
|
|
9
|
+
margin-right: 12px;
|
|
10
|
+
height: 42px;
|
|
11
|
+
border: 1px solid #222a3f;
|
|
12
|
+
color: #aaaaaa;
|
|
13
|
+
border-radius: 6px;
|
|
14
|
+
user-select: none;
|
|
15
|
+
transition: all ease-in-out 0.08s;
|
|
16
|
+
&:hover {
|
|
17
|
+
span {
|
|
18
|
+
color: white;
|
|
19
|
+
}
|
|
20
|
+
border-color: #6366f1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
img {
|
|
24
|
+
height: 16px;
|
|
25
|
+
margin-right: 8px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
span {
|
|
29
|
+
text-transform: uppercase;
|
|
30
|
+
color: #aaaaaa;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (max-width: 760px) {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
margin: 0 16px 4px;
|
|
37
|
+
text-wrap: nowrap;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
export const WalletOverview = ({ activeWallet, onClick, fallbackIcon, }) => {
|
|
41
|
+
const walletIcon = useMemo(() => {
|
|
42
|
+
return activeWallet?.meta.icon || fallbackIcon;
|
|
43
|
+
}, [activeWallet, fallbackIcon]);
|
|
44
|
+
return (_jsxs(SWalletOverview, { onClick: onClick, children: [walletIcon && (_jsx("img", { alt: activeWallet?.meta.name || "wallet", src: walletIcon })), _jsx("span", { children: activeWallet?.meta.name })] }));
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=WalletOverview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletOverview.js","sourceRoot":"","sources":["../../../src/components/WalletOverview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAc3C,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCjC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,YAAY,EACZ,OAAO,EACP,YAAY,GACQ,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC9B,OAAO,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC;IACjD,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;IAEjC,OAAO,CACL,MAAC,eAAe,IAAC,OAAO,EAAE,OAAO,aAC9B,UAAU,IAAI,CACb,cAAK,GAAG,EAAE,YAAY,EAAE,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,GAAG,EAAE,UAAU,GAAI,CACnE,EACD,yBAAO,YAAY,EAAE,IAAI,CAAC,IAAI,GAAQ,IACtB,CACnB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type HTMLMotionProps } from "framer-motion";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export declare enum ButtonEnum {
|
|
4
|
+
BASE = 0,
|
|
5
|
+
PRIMARY_1 = 1,
|
|
6
|
+
CONNECT_WALLET = 2,
|
|
7
|
+
WARNING = 3,
|
|
8
|
+
ERROR = 4,
|
|
9
|
+
ERROR_2 = 5
|
|
10
|
+
}
|
|
11
|
+
export interface ButtonProps extends HTMLMotionProps<"button"> {
|
|
12
|
+
buttonType: ButtonEnum;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
isLoading?: boolean;
|
|
16
|
+
loadingText?: string | JSX.Element;
|
|
17
|
+
isMinified?: boolean;
|
|
18
|
+
theme?: any;
|
|
19
|
+
}
|
|
20
|
+
import React from "react";
|
|
21
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/shared/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,oBAAY,UAAU;IACpB,IAAI,IAAA;IACJ,SAAS,IAAA;IACT,cAAc,IAAA;IACd,OAAO,IAAA;IACP,KAAK,IAAA;IACL,OAAO,IAAA;CACR;AAGD,MAAM,WAAW,WAAY,SAAQ,eAAe,CAAC,QAAQ,CAAC;IAC5D,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,MAAM,uFAqClB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BaseButton, ButtonContentWrapper, LoadingBar } from "./style";
|
|
3
|
+
export var ButtonEnum;
|
|
4
|
+
(function (ButtonEnum) {
|
|
5
|
+
ButtonEnum[ButtonEnum["BASE"] = 0] = "BASE";
|
|
6
|
+
ButtonEnum[ButtonEnum["PRIMARY_1"] = 1] = "PRIMARY_1";
|
|
7
|
+
ButtonEnum[ButtonEnum["CONNECT_WALLET"] = 2] = "CONNECT_WALLET";
|
|
8
|
+
ButtonEnum[ButtonEnum["WARNING"] = 3] = "WARNING";
|
|
9
|
+
ButtonEnum[ButtonEnum["ERROR"] = 4] = "ERROR";
|
|
10
|
+
ButtonEnum[ButtonEnum["ERROR_2"] = 5] = "ERROR_2";
|
|
11
|
+
})(ButtonEnum || (ButtonEnum = {}));
|
|
12
|
+
import React from "react";
|
|
13
|
+
export const Button = React.forwardRef(({ buttonType, disabled, isLoading = false, loadingText = "Loading", children, isMinified = false, theme, ...props }, ref) => {
|
|
14
|
+
return (_jsx(BaseButton, { ...props, ref: ref, transition: { duration: 0.25 }, buttonType: buttonType, disabled: disabled, isLoading: isLoading, "$isMinified": isMinified, theme: theme, children: _jsxs(ButtonContentWrapper, { children: [isLoading && (_jsx(LoadingBar, { "$side": "left", "$buttonType": buttonType, theme: theme })), _jsx("div", { children: isLoading ? loadingText : children }), isLoading && (_jsx(LoadingBar, { "$side": "right", "$buttonType": buttonType, theme: theme }))] }) }));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/shared/Button/index.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,+DAAc,CAAA;IACd,iDAAO,CAAA;IACP,6CAAK,CAAA;IACL,iDAAO,CAAA;AACT,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAaD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EACE,UAAU,EACV,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,SAAS,EACvB,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,OAAO,CACL,KAAC,UAAU,OACL,KAAK,EACT,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAC9B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,iBACP,UAAU,EACvB,KAAK,EAAE,KAAK,YAEZ,MAAC,oBAAoB,eAClB,SAAS,IAAI,CACZ,KAAC,UAAU,aAAO,MAAM,iBAAc,UAAU,EAAE,KAAK,EAAE,KAAK,GAAI,CACnE,EACD,wBAAM,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,GAAO,EAC9C,SAAS,IAAI,CACZ,KAAC,UAAU,aAAO,OAAO,iBAAc,UAAU,EAAE,KAAK,EAAE,KAAK,GAAI,CACpE,IACoB,GACZ,CACd,CAAC;AACJ,CAAC,CACF,CAAC"}
|