@cordystackx/cordy_minikit 1.5.27 → 1.5.34

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.
@@ -1,6 +1,6 @@
1
1
  interface ConnectWalletBTProps {
2
2
  className?: string;
3
3
  }
4
- export default function ConnectWalletBT({ className }: ConnectWalletBTProps): import("react").JSX.Element;
4
+ export default function ConnectWalletBT({ className, }: ConnectWalletBTProps): import("react").JSX.Element;
5
5
  export {};
6
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":"AAIA,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BAY1E"}
1
+ {"version":3,"file":"Connect_wallet_bt.d.ts","sourceRoot":"","sources":["../../components/Connect_wallet_bt.tsx"],"names":[],"mappings":"AAMA,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,GACV,EAAE,oBAAoB,+BAwBtB"}
@@ -1,9 +1,18 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useWalletModal } from "../wagmi__providers";
4
- import { useAccount } from "wagmi";
5
- export default function ConnectWalletBT({ className }) {
4
+ import { useAccount, useBalance } from "wagmi";
5
+ import { formatUnits } from "viem";
6
+ export default function ConnectWalletBT({ className, }) {
6
7
  const { openModal } = useWalletModal();
7
8
  const { isConnected, address } = useAccount();
8
- return (_jsx("button", { className: className, onClick: openModal, children: isConnected ? `Connected ${address}` : "Connect Wallet" }));
9
+ const { data: balance } = useBalance({
10
+ address,
11
+ });
12
+ const formattedBalance = balance
13
+ ? Number(formatUnits(balance.value, balance.decimals)).toFixed(4)
14
+ : "0.0000";
15
+ return (_jsx("button", { className: className, onClick: openModal, children: isConnected
16
+ ? `BAL ${formattedBalance} ${balance?.symbol ?? ""}`
17
+ : "Connect Wallet" }));
9
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,gCAyF9B"}
1
+ {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,OAAO,gCAqG9B"}
@@ -31,12 +31,12 @@ export default function UI_Comp() {
31
31
  if (balance === "") {
32
32
  Get_Balance();
33
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: "#2f9" }, children: ["Network: ", chain?.name || "Unknown"] }), _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
+ 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("div", { children: [_jsx(FaUser, { size: 70 }), _jsx("p", { style: { color: "#0f0" }, children: "Connected" }), _jsxs("p", { style: { color: "#2f9" }, children: ["Network: ", chain?.name || "Unknown"] }), _jsxs("p", { style: { color: "#0ff" }, children: ["Balance: ", Number(balance).toFixed(2), " ", symbol] }), _jsx("p", { style: { color: "#ff0" }, children: address })] })) : (_jsxs("span", { className: UI_Comp__css.blockchain_loader, children: [_jsx("span", { className: UI_Comp__css.node }), _jsx("span", { className: UI_Comp__css.node }), _jsx("span", { className: UI_Comp__css.node })] })) })), _jsx("button", { onClick: () => {
35
35
  closeModal();
36
36
  disconnect();
37
37
  }, children: "DisConnect" }), _jsxs("a", { href: links.NPM_Pack_links, children: ["Powered By CordyStackX | Version ", pkg.version] })] }) }));
38
38
  }
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
+ 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: [loading ? (_jsxs("span", { className: UI_Comp__css.blockchain_loader, children: [_jsx("span", { className: UI_Comp__css.node }), _jsx("span", { className: UI_Comp__css.node }), _jsx("span", { className: UI_Comp__css.node })] })) : null, _jsx(WalletButton, { onStatusChange: ({ isPending, error }) => {
40
40
  setLoading(isPending);
41
41
  setErrorMsg(error);
42
42
  } }), _jsx("p", { children: errorMsg })] }), _jsxs("a", { href: links.NPM_Pack_links, children: ["Powered By CordyStackX | Version ", pkg.version] })] }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,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,qBAwCA"}
1
+ {"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAKzC,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,qBA4CA"}
@@ -7,30 +7,33 @@ export default function WalletButton({ onStatusChange }) {
7
7
  const { connectors, connectAsync, status } = useConnect();
8
8
  const [pendingConnector, setPendingConnector] = React.useState(null);
9
9
  const [errorMsg, setErrorMsg] = React.useState(undefined);
10
- // Derived isPending (true/false only)
11
- const isPending = status === "pending";
10
+ const [isConnecting, setIsConnecting] = React.useState(false);
12
11
  // Notify parent whenever status changes
13
12
  useEffect(() => {
14
13
  if (onStatusChange) {
15
14
  onStatusChange({
16
- isPending,
15
+ isPending: isConnecting,
17
16
  error: errorMsg,
18
17
  });
19
18
  }
20
- }, [isPending, errorMsg, onStatusChange]);
19
+ }, [isConnecting, errorMsg, onStatusChange]);
21
20
  return (_jsx(_Fragment, { children: connectors.map((connector) => (_jsx(WalletOption, { connector: connector, onClick: async () => {
21
+ setIsConnecting(true);
22
+ setErrorMsg(undefined);
22
23
  setPendingConnector(connector);
23
- setErrorMsg(undefined); // reset old errors
24
24
  try {
25
25
  await connectAsync({ connector });
26
26
  }
27
27
  catch (err) {
28
28
  setErrorMsg(err?.message || "Connection failed");
29
+ setIsConnecting(false);
30
+ setPendingConnector(null);
29
31
  }
30
32
  finally {
33
+ setIsConnecting(false);
31
34
  setPendingConnector(null);
32
35
  }
33
- }, isPending: pendingConnector?.uid === connector.uid && isPending }, connector.uid))) }));
36
+ }, isPending: pendingConnector?.uid === connector.uid && isConnecting }, connector.uid))) }));
34
37
  }
35
38
  function WalletOption({ connector, onClick, isPending }) {
36
39
  const [installed, setInstalled] = React.useState(true);
@@ -50,7 +53,7 @@ function WalletOption({ connector, onClick, isPending }) {
50
53
  }
51
54
  })();
52
55
  }, [connector]);
53
- return (_jsxs("button", { onClick: onClick, children: [_jsx("img", { src: Images[connector.name] || Images["Coinbased Wallet"], alt: connector.name, title: connector.name, width: 23, height: 18 }), isPending
56
+ return (_jsxs("button", { disabled: !installed, onClick: onClick, children: [_jsx("img", { src: Images[connector.name] || Images["Coinbased Wallet"], alt: connector.name, title: connector.name, width: 23, height: 18 }), isPending
54
57
  ? "Connecting..."
55
58
  : isTrustWallet
56
59
  ? "Trust Wallet"
@@ -41,6 +41,7 @@
41
41
  .connector {
42
42
  width: min(400px, 100dvw);
43
43
  height: auto;
44
+ min-height: 400px;
44
45
  padding: 3rem 0;
45
46
  background-color: var(--background_wagmi_34535);
46
47
  position: fixed;
@@ -49,6 +50,10 @@
49
50
  overflow: hidden;
50
51
  animation: fadeIn 300ms ease forwards;
51
52
  border-radius: 8px;
53
+ display: flex;
54
+ justify-content: center;
55
+ align-items: center;
56
+ flex-flow: column;
52
57
  }
53
58
  .connector div {
54
59
  flex-flow: column;
@@ -82,20 +87,20 @@
82
87
  font-weight: bold;
83
88
  cursor: pointer;
84
89
  border: transparent;
85
- transition: all 500ms ease;
90
+ transition: all 300ms ease;
86
91
  margin: 1rem 0;
87
92
  }
88
93
  .connector button:hover {
89
94
  opacity: 0.5;
90
95
  }
91
96
  .connector button:active {
92
- transform: scale(0.9);
97
+ transform: scale(0.97);
93
98
  }
94
99
 
95
- .info span {
100
+ .info div {
96
101
  flex-flow: column;
97
102
  }
98
- .info span p {
103
+ .info div p {
99
104
  width: 80%;
100
105
  overflow: hidden;
101
106
  white-space: nowrap;
@@ -117,6 +122,7 @@
117
122
  .closed:hover {
118
123
  background-color: var(--meduim_dark_wagmi_34535);
119
124
  }
125
+
120
126
  @media (max-width: 800px) {
121
127
  .connector {
122
128
  bottom: 0;
@@ -125,3 +131,40 @@
125
131
  }
126
132
  }
127
133
 
134
+ .blockchain_loader {
135
+ display: flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ gap: 14px;
139
+ width: 100px;
140
+ height: 60px;
141
+ }
142
+
143
+ /* NODES (blocks) */
144
+ .node {
145
+ width: 14px;
146
+ height: 14px;
147
+ border-radius: 4px;
148
+ background: #00ffd5;
149
+ box-shadow: 0 0 10px #00ffd5, 0 0 20px rgba(0, 255, 213, 0.4);
150
+ animation: pulse 1.2s infinite ease-in-out;
151
+ }
152
+
153
+ .node:nth-child(1) { animation-delay: 0s; }
154
+ .node:nth-child(2) { animation-delay: 0.2s; }
155
+ .node:nth-child(3) { animation-delay: 0.4s; }
156
+
157
+ /* NODE PULSE */
158
+ @keyframes pulse {
159
+ 0%, 100% {
160
+ transform: scale(1);
161
+ opacity: 0.6;
162
+ box-shadow: 0 0 10px #00ffd5;
163
+ }
164
+ 50% {
165
+ transform: scale(1.4);
166
+ opacity: 1;
167
+ box-shadow: 0 0 20px #00ffd5, 0 0 40px rgba(0,255,213,0.6);
168
+ }
169
+ }
170
+
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cordystackx/cordy_minikit",
3
- "version": "1.5.26",
3
+ "version": "1.5.34",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,10 +39,11 @@
39
39
  "react": "^19.2.7",
40
40
  "react-dom": "^19.2.7",
41
41
  "react-icons": "^5.6.0",
42
+ "viem": "^2.53.1",
42
43
  "wagmi": "^3.6.17"
43
44
  },
44
45
  "devDependencies": {
45
- "@types/node": "^25.9.3",
46
+ "@types/node": "^25.9.4",
46
47
  "@types/react": "^19.2.17",
47
48
  "@types/react-dom": "^19.2.3"
48
49
  }