@cordystackx/cordy_minikit 0.9.7 → 1.3.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 CHANGED
@@ -1,93 +1,64 @@
1
1
  ---
2
- © 2025 Cordy StackX (@cordystackx)
2
+ © 2025 Cordy StackX (@cordystackx)
3
3
  Licensed under the MIT License.
4
4
  Unauthorized removal of this notice violates the license terms.
5
5
  ---
6
6
 
7
- # Github Official Repo
8
- ```bash
9
- https://github.com/cordyStackX/cordy_minikit_official.git
10
- ```
11
-
12
- # 🧩 cordy_minikit — Web3 Mini Kit by cordyStackX
13
-
14
- A lightweight Web3 toolkit for building wallet UIs, controllers, and provider wrappers — designed for modern frameworks like **Next.js** and **Vite**
15
- Built with **Wagmi**, **Viem**, **Ethers** and **TypeScript** (compiled to JS for runtime).
7
+ # 🧩 Cordy MiniKit — Web3 Toolkit by CordyStackX
16
8
 
17
- ---
9
+ [![npm version](https://img.shields.io/npm/v/@cordystackx/cordy_minikit.svg)](https://www.npmjs.com/package/@cordystackx/cordy_minikit)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
18
11
 
19
- ## 🚀 Features
12
+ A lightweight, production-ready Web3 toolkit for building wallet UIs, controllers, and provider wrappers — designed for modern frameworks like **Next.js** and **Vite**.
13
+ Built with **Wagmi**, **Viem**, **Ethers**, and **TypeScript**.
20
14
 
21
- - 🔗 **Wallet Connect / Disconnect**
22
- Simple connect button and hooks for EVM-based wallets.
23
- - 🧰 **Prebuilt UI Components**
24
- Reusable components like `ConnectWalletBT`, `CordyStackTrans`.
25
- - ⚙️ **Controllers**
26
- Manage wallet actions, balances, and transactions.
27
- - 🎨 **CSS Modules + CSS Variables**
28
- Easy theming support for dark/light mode.
29
- - 📦 **Tree-shakable, Typed, and Lightweight**
30
- - 🧩 **Framework-Agnostic**
31
- Works with Next.js or Vite.
15
+ **📦 [NPM Package](https://www.npmjs.com/package/@cordystackx/cordy_minikit)** | **📂 [GitHub Repository](https://github.com/cordyStackX/cordy_minikit_official)**
32
16
 
33
17
  ---
34
18
 
35
- ## 🧭 SOA — System Overview & Architecture
36
-
37
- > A concise overview of the library’s structure, purpose, and build/publish process.
38
-
39
- ### 1. Purpose
40
-
41
- `@cordystackx/cordy_minikit` provides modular Web3 utilities and UI components for dApp builders.
42
- It’s designed to be embedded in frontend frameworks where you want instant Web3 wallet connectivity and a clean UI layer.
19
+ ## 🚀 Features
43
20
 
44
- **Main Goals:**
45
- - Simplify wallet integrations.
46
- - Provide clean, framework-ready UI + controllers.
47
- - Maintain portability for fullstack and extension apps.
48
- - Keep theming customizable with CSS variables.
21
+ - 🔗 **Wallet Connect/Disconnect** — Simple hooks and buttons for EVM-based wallets
22
+ - 🧰 **Prebuilt UI Components** — Ready-to-use `ConnectWalletBT`, `UI_Comp`, and more
23
+ - ⚙️ **Smart Controllers** — Manage wallet actions, balances, and transactions effortlessly
24
+ - 💸 **Transaction Helpers** — Built-in ERC20 and native token transfer functions
25
+ - 🎨 **Themeable CSS** — CSS Modules with variables for easy dark/light mode support
26
+ - 📦 **Tree-shakable & Typed** — Optimized bundle size with full TypeScript definitions
27
+ - 🧩 **Framework-Agnostic** — Works seamlessly with Next.js, Vite, and more
28
+ - 🌐 **Multi-Chain Support** — Custom chain configuration support
49
29
 
50
30
  ---
51
31
 
52
- ### 2. High-level Architecture
32
+ ## 📦 Installation
53
33
 
54
34
  ```bash
55
- root
56
- ├── chains/ # chain definitions and helpers
57
- ├── client__provider.tsx # provider client wrapper (wagmi/viem context)
58
- ├── components/ # UI components (Connect_wallet_bt, UI_Comp)
59
- ├── controllers/ # imperative components & logic (wallet ops)
60
- ├── config/ # ABIs and static configuration
61
- ├── css/ # CSS Modules and styles
62
- ├── dist/ # compiled JS + .d.ts for publishing
63
- ├── index.ts # main export aggregator
64
- └── package.json
35
+ npm install @cordystackx/cordy_minikit@latest
36
+ # or
37
+ pnpm add @cordystackx/cordy_minikit@latest
38
+ # or
39
+ yarn add @cordystackx/cordy_minikit@latest
65
40
  ```
66
41
 
42
+ ---
67
43
 
44
+ ## 🛠️ Quick Start
68
45
 
69
- # Get Started
70
-
71
- ## Setup
46
+ ### 1. Environment Setup
72
47
 
73
- 1. Install the NPM Packages
74
- ```bash
75
- npm i @cordystackx/cordy_minikit@latest
76
- ```
48
+ Create a `.env.local` file in your project root:
77
49
 
78
- 2. Create env file
79
50
  ```bash
80
- NEXT_PUBLIC_RPC_ENDPOINT=
81
- NEXT_PUBLIC_TOKENADDRESS=
82
- NEXT_PUBLIC_PLATFORM_ADDRESS=
83
- NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
51
+ NEXT_PUBLIC_RPC_ENDPOINT=https://your-rpc-endpoint.com
52
+ NEXT_PUBLIC_TOKENADDRESS=0x...
53
+ NEXT_PUBLIC_PLATFORM_ADDRESS=0x...
54
+ NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id
84
55
  ```
85
56
 
86
- 3. Create folder of /services/minikit/providers.ts
57
+ ### 2. Provider Setup
87
58
 
88
- > Note: Make sure you install @tanstack/react-query for QueryClient and QueryClientProviders
59
+ Create a providers file at `/app/providers.tsx` or `/services/minikit/providers.tsx`:
89
60
 
90
- ```ts
61
+ ```tsx
91
62
  "use client";
92
63
  import { ReactNode } from "react";
93
64
  import { ProvidersClientWrapper } from "@cordystackx/cordy_minikit";
@@ -96,116 +67,352 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
96
67
  const queryClient = new QueryClient();
97
68
 
98
69
  export default function Providers({ children }: { children: ReactNode }) {
99
-
100
- return(
101
- <QueryClientProvider client={queryClient}>
102
- <ProvidersClientWrapper>
103
- {children}
104
- </ProvidersClientWrapper>
105
- </QueryClientProvider>
106
- );
107
-
70
+ return (
71
+ <QueryClientProvider client={queryClient}>
72
+ <ProvidersClientWrapper>
73
+ {children}
74
+ </ProvidersClientWrapper>
75
+ </QueryClientProvider>
76
+ );
108
77
  }
109
78
  ```
110
79
 
111
- 4. then import it both CSS Module into the /app/layout.tsx
112
- ```ts
80
+ > **Note:** Install `@tanstack/react-query` as a peer dependency:
81
+ > ```bash
82
+ > npm install @tanstack/react-query
83
+ > ```
113
84
 
114
- import {
115
- Providers
116
- } from "@/app/services/minikit/providers";
117
- import '@cordystackx/cordy_minikit/dist/css/UI_Comp/styles.module.css';
118
- import '@cordystackx/cordy_minikit/dist/css/Buttons/styles.module.css';
85
+ ### 3. Layout Integration
86
+
87
+ Import the providers and CSS in your `/app/layout.tsx`:
88
+
89
+ ```tsx
90
+ import Providers from "@/app/providers";
91
+ import "@cordystackx/cordy_minikit/dist/css/UI_Comp/styles.module.css";
119
92
 
120
93
  export default function RootLayout({
121
94
  children,
122
- }: Readonly<{
95
+ }: {
123
96
  children: React.ReactNode;
124
- }>) {
97
+ }) {
125
98
  return (
126
99
  <html lang="en">
127
- <body className={`${geistSans.variable} ${geistMono.variable}`}>
128
- <Providers>
129
- {children}
130
- </Providers>
100
+ <body>
101
+ <Providers>
102
+ {children}
103
+ </Providers>
131
104
  </body>
132
105
  </html>
133
106
  );
134
107
  }
135
108
  ```
136
109
 
137
- ## Usage
110
+ ---
111
+
112
+ ## 📚 Usage Examples
113
+
114
+ ### 1. Connect Wallet Button
115
+
116
+ The `ConnectWalletBT` component provides a plug-and-play wallet connection button.
117
+
118
+ ```tsx
119
+ import { ConnectWalletBT } from "@cordystackx/cordy_minikit";
120
+
121
+ export default function Header() {
122
+ return (
123
+ <nav>
124
+ <ConnectWalletBT className="your-custom-class" />
125
+ </nav>
126
+ );
127
+ }
128
+ ```
129
+
130
+ **Features:**
131
+ - Automatically shows "Connect Wallet" when disconnected
132
+ - Displays wallet address when connected
133
+ - Fully customizable with `className` prop
134
+
135
+ ---
136
+
137
+ ### 2. Wallet Modal Hook
138
138
 
139
- 1. Connect Buttons — ConnectWalletBT
140
- The ConnectWalletBT component provides a plug-and-play wallet connection button for any Web3 application.
141
- It automatically handles connecting, disconnecting, and managing wallet sessions using Wagmi and Viem under the hood.
139
+ Use the `useWalletModal` hook to trigger the wallet modal programmatically:
142
140
 
143
- ```ts
144
- import {
145
- ConnectWalletBT
146
- } from "@cordystackx/cordy_minikit";
141
+ ```tsx
142
+ import { useWalletModal } from "@cordystackx/cordy_minikit";
147
143
 
148
- <ConnectWalletBT />
144
+ function CustomButton() {
145
+ const { openModal, closeModal } = useWalletModal();
146
+
147
+ return (
148
+ <button onClick={openModal}>
149
+ Open Wallet
150
+ </button>
151
+ );
152
+ }
149
153
  ```
150
154
 
151
- 2. Button Transactions - CordyStackTrans
155
+ ---
156
+
157
+ ### 3. Transaction Handler
152
158
 
153
- The CordyStackTrans function provides a simple and reusable transaction handler for EVM-based networks.
154
- It allows developers to trigger ERC20 or native token transfers directly from UI components with minimal setup.
159
+ The `CordyStackTrans` function handles ERC20 and native token transfers:
155
160
 
156
- ```ts
161
+ ```tsx
157
162
  import { CordyStackTrans } from "@cordystackx/cordy_minikit";
158
163
 
159
- // Example Usage
160
- CordyStackTrans(address: string, cost: number);
164
+ async function handlePayment() {
165
+ const recipientAddress = "0x...";
166
+ const amount = 10; // Token amount
161
167
 
162
- const trans = CordyStackTrans();
168
+ const success = await CordyStackTrans(recipientAddress, amount);
163
169
 
164
- if (trans) {
165
- return true; // Transaction successfull
166
- } else {
167
- return false; // Transaction failed or rejected
170
+ if (success) {
171
+ console.log("Transaction successful!");
172
+ } else {
173
+ console.log("Transaction failed or rejected");
174
+ }
168
175
  }
169
176
  ```
170
177
 
178
+ ---
179
+
180
+ ### 4. Custom Chain Support
181
+
182
+ Configure custom chains for your dApp:
183
+
184
+ ```tsx
185
+ import { getConfig, ProvidersClientWrapper } from "@cordystackx/cordy_minikit";
186
+ import { defineChain } from "viem";
187
+
188
+ // Define your custom chain
189
+ const myCustomChain = defineChain({
190
+ id: 1114,
191
+ name: "Core Blockchain Testnet",
192
+ network: "core-testnet",
193
+ nativeCurrency: { name: "tCORE", symbol: "tCORE", decimals: 18 },
194
+ rpcUrls: {
195
+ default: { http: ["https://rpc.test.btcs.network"] },
196
+ public: { http: ["https://rpc.test.btcs.network"] },
197
+ },
198
+ blockExplorers: {
199
+ default: { name: "Core Scan", url: "https://scan.test.btcs.network" },
200
+ },
201
+ });
202
+
203
+ // Get config with custom chain
204
+ const customConfig = getConfig({ myCustomChain });
205
+
206
+ // Use in provider
207
+ export default function Providers({ children }: { children: ReactNode }) {
208
+ return (
209
+ <ProvidersClientWrapper config={customConfig}>
210
+ {children}
211
+ </ProvidersClientWrapper>
212
+ );
213
+ }
214
+ ```
215
+
216
+ ---
217
+
218
+ ## 🏗️ Architecture Overview
219
+
220
+ ### Project Structure
221
+
222
+ ```
223
+ cordy_minikit/
224
+ ├── assets/ # Image Sources for logo
225
+ ├── components/ # UI components (ConnectWalletBT, UI_Comp)
226
+ ├── controllers/ # Transaction logic and wallet operations
227
+ ├── config/ # ABIs and static configurations
228
+ ├── css/ # CSS Modules and theming
229
+ ├── dist/ # Compiled output (published to npm)
230
+ ├── index.ts # Main export entry point
231
+ └── package.json
232
+ ```
233
+
234
+ ### Key Files
171
235
 
172
- **Runtime contract:**
173
- - Imports resolve to `dist/index.js`
174
- - `.d.ts` shipped for TS projects
175
- - Pure ESM/JS compatible with Next.js and Vite
236
+ | File/Folder | Description |
237
+ |-------------|-------------|
238
+ | `assets/` | Image Sources for logo |
239
+ | `client__provider.tsx` | React provider wrapper for Wagmi/Viem |
240
+ | `components/` | Reusable UI components for wallet interactions |
241
+ | `controllers/` | Business logic for Web3 operations |
242
+ | `config/` | ERC20 ABI and configuration files |
243
+ | `css/` | Scoped CSS Modules with theming support |
244
+ | `dist/` | Compiled JavaScript + TypeScript declarations |
176
245
 
177
246
  ---
178
247
 
179
- ### 3. File Responsibilities
248
+ ## 🧭 System Architecture — Cordy Minikit
249
+
250
+ @cordystackx/cordy_minikit is built as a modular Web3 toolkit that sits on top of Wagmi, Viem, Ethers, and Coinbase Wallet SDK, providing developers with prebuilt UI components, controllers, and configuration files for seamless wallet and transaction management.
251
+
252
+
253
+ ```mermaid
254
+ flowchart TD
255
+ %% Layer 1 - External Dependencies
256
+ subgraph External_Libraries["🔌 External Libraries"]
257
+ A1["wagmi (Wallet & Hooks)"]
258
+ A2["viem (RPC / EVM Utils)"]
259
+ A3["ethers.js (Tx + ABI Handling)"]
260
+ A4["Coinbase Wallet SDK (Wallet Provider)"]
261
+ end
262
+
263
+ %% Layer 2 - Core Logic
264
+ subgraph Core["⚙️ Core Logic Layer"]
265
+ B1["client__provider.tsx (Wagmi & Viem Client Context)"]
266
+ B2["controllers/ (Balance, Tx, WagmiButton)"]
267
+ B3["config/ (ERC20_ABI, walletConfig, links.json)"]
268
+ end
269
+
270
+ %% Layer 3 - UI Components
271
+ subgraph UI["🧩 UI Components"]
272
+ C1["Connect_wallet_bt.tsx (Connect/Disconnect Button)"]
273
+ C2["UI_Comp.tsx (Visual/Interactive UI Elements)"]
274
+ C3["CSS Modules (Dark/Light Theme Styles)"]
275
+ end
276
+
277
+ %% Layer 4 - Assets & Static Files
278
+ subgraph Assets["🖼️ Assets"]
279
+ D1["Wallet Logos (Coinbase, Metamask, WalletConnect)"]
280
+ D2["Static Config Files (Image.json, etc.)"]
281
+ end
282
+
283
+ %% Layer 5 - Output
284
+ subgraph Output["📦 Build & Distribution"]
285
+ E1["dist/ (Compiled JS + .d.ts Types)"]
286
+ E2["index.ts (Library Entry Point)"]
287
+ E3["NPM Registry (Public Package)"]
288
+ end
289
+
290
+ %% Connections
291
+ A1 & A2 & A3 & A4 --> B1
292
+ B1 --> B2
293
+ B2 --> B3
294
+ B2 --> C1
295
+ C1 --> C2
296
+ C2 --> C3
297
+ B3 --> C1
298
+ C3 --> D1
299
+ D1 --> E1
300
+ E1 --> E2
301
+ E2 --> E3
180
302
 
181
- | Folder/File | Description |
182
- |--------------|-------------|
183
- | `chains/*` | Chain configuration and utilities (Sepolia, Base, etc.) |
184
- | `client__provider.tsx` | React provider wrapper for Wagmi/Viem clients |
185
- | `components/*` | Connect wallet, UI components |
186
- | `controllers/*` | Logic-based hooks and components for Web3 ops |
187
- | `config/*` | ABIs, static configs |
188
- | `css/*` | Scoped CSS Modules and base theme |
189
- | `dist/*` | Compiled JS & type declarations (published bundle) |
303
+ ```
304
+
305
+ ## 🔧 API Reference
306
+
307
+ ### Components
308
+
309
+ #### `ConnectWalletBT`
310
+ ```tsx
311
+ <ConnectWalletBT className?: string />
312
+ ```
313
+ - Props: `className` (optional) - Custom CSS class
314
+
315
+
316
+ ### Hooks
317
+
318
+ #### `useWalletModal()`
319
+ ```tsx
320
+ const { openModal, closeModal } = useWalletModal();
321
+ ```
322
+ - Returns: `{ openModal: () => void, closeModal: () => void }`
323
+
324
+ ### Functions
325
+
326
+ #### `CordyStackTrans(address, amount)`
327
+ ```tsx
328
+ const success = await CordyStackTrans(recipientAddress: string, amount: number);
329
+ ```
330
+ - Returns: `Promise<boolean>` - Transaction success status
331
+
332
+ #### `getConfig(customChains?)`
333
+ ```tsx
334
+ const config = getConfig({ myChain: customChainDefinition });
335
+ ```
336
+ - Returns: Wagmi configuration with custom chains
190
337
 
191
338
  ---
192
339
 
193
- ### 4. Build & Publish (npm)
340
+ ## 🎨 Customization
194
341
 
195
- #### ✅ Setup `package.json`
196
- ```json
197
- {
198
- "main": "dist/index.js",
199
- "types": "dist/index.d.ts",
200
- "files": ["dist"],
201
- "scripts": {
202
- "clean": "rm -rf dist",
203
- "build": "tsc",
204
- "prepublishOnly": "pnpm run build"
205
- },
206
- "publishConfig": {
207
- "access": "public",
208
- "registry": "https://registry.npmjs.org/"
209
- }
342
+ ### CSS Variables
343
+
344
+ Override default styles using CSS variables:
345
+
346
+ ```css
347
+ :root {
348
+ --foreground_wagmi: #ffffff;
349
+ --background_wagmi: #000000;
350
+ /* Add more custom variables */
351
+ }
352
+ ```
353
+
354
+ ### Custom Styling
355
+
356
+ ```tsx
357
+ <ConnectWalletBT className="my-custom-button" />
358
+ ```
359
+
360
+ ```css
361
+ .my-custom-button {
362
+ background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
363
+ border-radius: 8px;
364
+ padding: 12px 24px;
365
+ font-weight: 600;
210
366
  }
211
- ```
367
+ ```
368
+
369
+ ---
370
+
371
+ ## 📋 Requirements
372
+
373
+ - **React**: ^18.3.1
374
+ - **Next.js**: ^14.2.33 (for Next.js projects)
375
+ - **@tanstack/react-query**: ^5.90.3
376
+ - **wagmi**: ^2.18.1
377
+ - **viem**: Latest version
378
+ - **ethers**: ^6.15.0
379
+
380
+ ---
381
+
382
+ ## 🤝 Contributing
383
+
384
+ Contributions are welcome! Please feel free to submit a Pull Request.
385
+
386
+ 1. Fork the repository
387
+ 2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
388
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
389
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
390
+ 5. Open a Pull Request
391
+
392
+ ---
393
+
394
+ ## 📄 License
395
+
396
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
397
+
398
+ ---
399
+
400
+ ## 🔗 Links
401
+
402
+ - **NPM Package**: https://www.npmjs.com/package/@cordystackx/cordy_minikit
403
+ - **GitHub Repository**: https://github.com/cordyStackX/cordy_minikit_official
404
+ - **Official Website**: https://cordy-stack-x.vercel.app/
405
+
406
+ ---
407
+
408
+ ## 💬 Support
409
+
410
+ For issues, questions, or feature requests:
411
+ - Open an issue on [GitHub](https://github.com/cordyStackX/cordy_minikit_official/issues)
412
+ - Visit our [website](https://cordy-stack-x.vercel.app/)
413
+
414
+ ---
415
+
416
+ **Built with ❤️ by [CordyStackX](https://cordy-stack-x.vercel.app/)**
417
+
418
+ ---
@@ -1,2 +1,6 @@
1
- export default function ConnectWalletBT(): import("react/jsx-runtime").JSX.Element;
1
+ interface ConnectWalletBTProps {
2
+ className?: string;
3
+ }
4
+ export default function ConnectWalletBT({ className }: ConnectWalletBTProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
2
6
  //# sourceMappingURL=Connect_wallet_bt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Connect_wallet_bt.d.ts","sourceRoot":"","sources":["../../components/Connect_wallet_bt.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,eAAe,4CAYtC"}
1
+ {"version":3,"file":"Connect_wallet_bt.d.ts","sourceRoot":"","sources":["../../components/Connect_wallet_bt.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB,2CAY1E"}
@@ -1,10 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Buttons__css } from "../css";
4
3
  import { useWalletModal } from "../wagmi__providers";
5
4
  import { useAccount } from "wagmi";
6
- export default function ConnectWalletBT() {
5
+ export default function ConnectWalletBT({ className }) {
7
6
  const { openModal } = useWalletModal();
8
7
  const { isConnected, address } = useAccount();
9
- return (_jsx("button", { className: Buttons__css.button__button, onClick: openModal, children: isConnected ? `Connected ${address}` : "Connect Wallet" }));
8
+ return (_jsx("button", { className: className, onClick: openModal, children: isConnected ? `Connected ${address}` : "Connect Wallet" }));
10
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,4CAyF9B"}
1
+ {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,4CAwF9B"}
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import Image__src from "../config/Image.json";
4
3
  import { UI_Comp__css } from "../css";
5
4
  import { WalletButton, getTokenBalance } from "../controllers";
6
5
  import { useWalletModal } from "../wagmi__providers";
7
6
  import { useAccount, useDisconnect } from "wagmi";
8
7
  import { FaUser } from 'react-icons/fa';
9
8
  import { useState, useEffect } from "react";
9
+ import pkg from "../package.json";
10
+ import links from "../config/links.json";
10
11
  export default function UI_Comp() {
11
12
  const { closeModal } = useWalletModal();
12
13
  const { isConnected, address } = useAccount();
@@ -33,10 +34,10 @@ export default function UI_Comp() {
33
34
  return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("div", { className: UI_Comp__css.connector, children: [_jsx("p", { className: UI_Comp__css.closed, onClick: closeModal, children: "\u2715" }), isConnected && (_jsx("div", { className: UI_Comp__css.info, children: balance ? (_jsxs("span", { children: [_jsx(FaUser, { size: 70 }), _jsx("p", { style: { color: "#0f0" }, children: "Connected" }), _jsxs("p", { style: { color: "#0ff" }, children: ["Balance: ", Number(balance).toFixed(2), " ", symbol] }), _jsx("p", { style: { color: "#ff0" }, children: address })] })) : (_jsx("p", { style: { color: "var(--foreground_wagmi)" }, children: "Loading balance..." })) })), _jsx("button", { onClick: () => {
34
35
  closeModal();
35
36
  disconnect();
36
- }, children: "DisConnect" }), _jsx("a", { href: "https://cordy-stack-x.vercel.app/", children: "Powered By CordyStackX" })] }) }));
37
+ }, children: "DisConnect" }), _jsxs("a", { href: links.NPM_Pack_links, children: ["Powered By CordyStackX | Version ", pkg.version] })] }) }));
37
38
  }
38
- return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("div", { className: UI_Comp__css.connector, children: [_jsx("p", { className: UI_Comp__css.closed, onClick: closeModal, children: "\u2715" }), _jsx("img", { src: Image__src.logo, width: 50, height: 50 }), _jsx("h2", { children: "Cordy MiniKit" }), _jsxs("div", { children: [_jsx("h3", { children: loading ? "Loading..." : "" }), _jsx(WalletButton, { onStatusChange: ({ isPending, error }) => {
39
+ return (_jsx("div", { className: UI_Comp__css.container, children: _jsxs("div", { className: UI_Comp__css.connector, children: [_jsx("p", { className: UI_Comp__css.closed, onClick: closeModal, children: "\u2715" }), _jsx("h2", { children: "Connect Your Wallet" }), _jsxs("div", { children: [_jsx("h3", { children: loading ? "Loading..." : "" }), _jsx(WalletButton, { onStatusChange: ({ isPending, error }) => {
39
40
  setLoading(isPending);
40
41
  setErrorMsg(error);
41
- } }), _jsx("p", { children: errorMsg })] }), _jsx("a", { href: "https://cordy-stack-x.vercel.app/", children: "Powered By CordyStackX" })] }) }));
42
+ } }), _jsx("p", { children: errorMsg })] }), _jsxs("a", { href: links.NPM_Pack_links, children: ["Powered By CordyStackX | Version ", pkg.version] })] }) }));
42
43
  }
@@ -1,3 +1,6 @@
1
1
  {
2
- "logo": "https://cordy-stack-x.vercel.app/logo.svg"
2
+ "logo": "https://cordy-stack-x.vercel.app/logo.svg",
3
+ "Coinbased Wallet": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/main/assets/coinbased.svg",
4
+ "MetaMask": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/main/assets/metamask.png",
5
+ "WalletConnect": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/main/assets/WalletConnect.png"
3
6
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "NPM_Pack_links": "https://www.npmjs.com/package/@cordystackx/cordy_minikit"
3
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,cAAc,EACf,EAAE;IACD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAC1E,2CAwCA"}
1
+ {"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"AAMA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,cAAc,EACf,EAAE;IACD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CAC1E,2CAwCA"}
@@ -1,7 +1,8 @@
1
1
  "use client";
2
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import React, { useEffect } from "react";
4
4
  import { useConnect } from "wagmi";
5
+ import Images from "../config/Image.json";
5
6
  export default function WalletButton({ onStatusChange }) {
6
7
  const { connectors, connectAsync, status } = useConnect();
7
8
  const [pendingConnector, setPendingConnector] = React.useState(null);
@@ -45,9 +46,9 @@ function WalletOption({ connector, onClick, isPending }) {
45
46
  })();
46
47
  }, [connector]);
47
48
  const disabled = isPending || !installed;
48
- return (_jsx("button", { disabled: disabled, onClick: onClick, children: isPending
49
- ? "Connecting..."
50
- : !installed
51
- ? `${connector.name} (Not Installed)`
52
- : connector.name }));
49
+ return (_jsxs("button", { disabled: disabled, onClick: onClick, children: [_jsx("img", { src: Images[connector.name] || Images["Coinbased Wallet"], alt: connector.name, width: 23, height: 18 }), isPending
50
+ ? "Connecting..."
51
+ : !installed
52
+ ? `${connector.name} (Not Installed)`
53
+ : connector.name] }));
53
54
  }