@cordystackx/cordy_minikit 1.5.23 → 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.
- package/dist/components/Connect_wallet_bt.d.ts +1 -1
- package/dist/components/Connect_wallet_bt.d.ts.map +1 -1
- package/dist/components/Connect_wallet_bt.js +12 -3
- package/dist/components/UI_Comp.d.ts.map +1 -1
- package/dist/components/UI_Comp.js +2 -2
- package/dist/config/Image.json +2 -1
- package/dist/controllers/WagmiButton.d.ts.map +1 -1
- package/dist/controllers/WagmiButton.js +19 -13
- package/dist/css/UI_Comp/styles.module.css +49 -6
- package/dist/package.json +4 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -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":"
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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("
|
|
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: [
|
|
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] })] }) }));
|
package/dist/config/Image.json
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
"logo": "https://cordy-stack-x.vercel.app/logo.svg",
|
|
3
3
|
"Coinbased Wallet": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/main/assets/coinbased.svg",
|
|
4
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"
|
|
5
|
+
"WalletConnect": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/main/assets/WalletConnect.png",
|
|
6
|
+
"Trust Wallet": "https://raw.githubusercontent.com/cordyStackX/cordy_minikit_official/refs/heads/main/assets/trust-wallet-icon.png"
|
|
6
7
|
}
|
|
@@ -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,
|
|
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,37 +7,41 @@ 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
|
-
|
|
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
|
-
}, [
|
|
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 &&
|
|
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);
|
|
40
|
+
const isTrustWallet = connector.name === "Trust Wallet";
|
|
37
41
|
React.useEffect(() => {
|
|
38
42
|
(async () => {
|
|
39
43
|
try {
|
|
40
|
-
if (connector.
|
|
44
|
+
if (connector.name === "WalletConnect" || isTrustWallet) {
|
|
41
45
|
setInstalled(true);
|
|
42
46
|
return;
|
|
43
47
|
}
|
|
@@ -49,11 +53,13 @@ function WalletOption({ connector, onClick, isPending }) {
|
|
|
49
53
|
}
|
|
50
54
|
})();
|
|
51
55
|
}, [connector]);
|
|
52
|
-
return (_jsxs("button", { onClick: onClick, children: [_jsx("img", { src: Images[connector.name] || Images["Coinbased Wallet"], alt: 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
|
|
53
57
|
? "Connecting..."
|
|
54
|
-
:
|
|
55
|
-
? "
|
|
56
|
-
:
|
|
57
|
-
?
|
|
58
|
-
:
|
|
58
|
+
: isTrustWallet
|
|
59
|
+
? "Trust Wallet"
|
|
60
|
+
: connector.name === "WalletConnect"
|
|
61
|
+
? "WalletConnect"
|
|
62
|
+
: !installed
|
|
63
|
+
? `${connector.name} (Not Installed)`
|
|
64
|
+
: connector.name] }));
|
|
59
65
|
}
|
|
@@ -41,14 +41,19 @@
|
|
|
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;
|
|
47
48
|
box-shadow: 0 0 1rem 0.1rem var(--meduim_dark_wagmi_34535);
|
|
48
49
|
flex-flow: column;
|
|
49
50
|
overflow: hidden;
|
|
50
|
-
animation: fadeIn
|
|
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;
|
|
@@ -64,7 +69,7 @@
|
|
|
64
69
|
@keyframes fadeIn {
|
|
65
70
|
from {
|
|
66
71
|
opacity: 0;
|
|
67
|
-
transform: translateY(
|
|
72
|
+
transform: translateY(30px);
|
|
68
73
|
}
|
|
69
74
|
to {
|
|
70
75
|
opacity: 1;
|
|
@@ -82,20 +87,20 @@
|
|
|
82
87
|
font-weight: bold;
|
|
83
88
|
cursor: pointer;
|
|
84
89
|
border: transparent;
|
|
85
|
-
transition: all
|
|
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.
|
|
97
|
+
transform: scale(0.97);
|
|
93
98
|
}
|
|
94
99
|
|
|
95
|
-
.info
|
|
100
|
+
.info div {
|
|
96
101
|
flex-flow: column;
|
|
97
102
|
}
|
|
98
|
-
.info
|
|
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.
|
|
3
|
+
"version": "1.5.34",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,17 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@coinbase/wallet-sdk": "4.3.7",
|
|
35
35
|
"@tanstack/react-query": "^5.101.0",
|
|
36
|
+
"@walletconnect/ethereum-provider": "^2.23.9",
|
|
36
37
|
"ethers": "^6.17.0",
|
|
37
38
|
"next": "^16.2.9",
|
|
38
39
|
"react": "^19.2.7",
|
|
39
40
|
"react-dom": "^19.2.7",
|
|
40
41
|
"react-icons": "^5.6.0",
|
|
42
|
+
"viem": "^2.53.1",
|
|
41
43
|
"wagmi": "^3.6.17"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
44
|
-
"@types/node": "^25.9.
|
|
46
|
+
"@types/node": "^25.9.4",
|
|
45
47
|
"@types/react": "^19.2.17",
|
|
46
48
|
"@types/react-dom": "^19.2.3"
|
|
47
49
|
}
|