@cordystackx/cordy_minikit 0.9.7 → 1.2.4
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 +1 -1
- package/dist/components/Connect_wallet_bt.d.ts +5 -1
- package/dist/components/Connect_wallet_bt.d.ts.map +1 -1
- package/dist/components/Connect_wallet_bt.js +2 -3
- package/dist/components/UI_Comp.d.ts.map +1 -1
- package/dist/components/UI_Comp.js +5 -4
- package/dist/config/Image.json +4 -1
- package/dist/config/links.json +3 -0
- package/dist/controllers/WagmiButton.d.ts.map +1 -1
- package/dist/controllers/WagmiButton.js +7 -6
- package/dist/css/UI_Comp/styles.module.css +38 -10
- package/dist/css/index.d.ts +1 -2
- package/dist/css/index.d.ts.map +1 -1
- package/dist/css/index.js +1 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/package.json +48 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/chains/base__sepolia.d.ts +0 -43
- package/dist/chains/base__sepolia.d.ts.map +0 -1
- package/dist/chains/base__sepolia.js +0 -30
- package/dist/chains/core.d.ts +0 -40
- package/dist/chains/core.d.ts.map +0 -1
- package/dist/chains/core.js +0 -27
- package/dist/chains/index.d.ts +0 -3
- package/dist/chains/index.d.ts.map +0 -1
- package/dist/chains/index.js +0 -3
- package/dist/controllers/Disconnect.d.ts +0 -2
- package/dist/controllers/Disconnect.d.ts.map +0 -1
- package/dist/controllers/Disconnect.js +0 -6
- package/dist/css/Buttons/styles.module.css +0 -40
package/README.md
CHANGED
|
@@ -115,7 +115,6 @@ import {
|
|
|
115
115
|
Providers
|
|
116
116
|
} from "@/app/services/minikit/providers";
|
|
117
117
|
import '@cordystackx/cordy_minikit/dist/css/UI_Comp/styles.module.css';
|
|
118
|
-
import '@cordystackx/cordy_minikit/dist/css/Buttons/styles.module.css';
|
|
119
118
|
|
|
120
119
|
export default function RootLayout({
|
|
121
120
|
children,
|
|
@@ -137,6 +136,7 @@ export default function RootLayout({
|
|
|
137
136
|
## Usage
|
|
138
137
|
|
|
139
138
|
1. Connect Buttons — ConnectWalletBT
|
|
139
|
+
|
|
140
140
|
The ConnectWalletBT component provides a plug-and-play wallet connection button for any Web3 application.
|
|
141
141
|
It automatically handles connecting, disconnecting, and managing wallet sessions using Wagmi and Viem under the hood.
|
|
142
142
|
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
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":"
|
|
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:
|
|
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":"
|
|
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" }),
|
|
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("
|
|
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 })] }),
|
|
42
|
+
} }), _jsx("p", { children: errorMsg })] }), _jsxs("a", { href: links.NPM_Pack_links, children: ["Powered By CordyStackX | Version ", pkg.version] })] }) }));
|
|
42
43
|
}
|
package/dist/config/Image.json
CHANGED
|
@@ -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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"
|
|
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 (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--foreground_wagmi_34535: #171717;
|
|
3
|
+
--meduim_dark_wagmi_34535: #818181;
|
|
4
|
+
--background_wagmi_34535: #FAFAFA;
|
|
5
|
+
--invert-cordy-image_34535: invert(1);
|
|
6
|
+
--invert-cordy-image_1_34535: invert(0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media (prefers-color-scheme: dark) {
|
|
10
|
+
:root {
|
|
11
|
+
--foreground_wagmi_34535: #ededed;
|
|
12
|
+
--meduim_dark_wagmi_34535: #252525;
|
|
13
|
+
--background_wagmi_34535: #121212;
|
|
14
|
+
--invert-cordy-image_34535: invert(0);
|
|
15
|
+
--invert-cordy-image_1_34535: invert(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
1
19
|
.container,
|
|
2
20
|
.connector,
|
|
3
21
|
.connector div,
|
|
4
22
|
.info,
|
|
5
|
-
.info span
|
|
23
|
+
.info span,
|
|
24
|
+
.connector button {
|
|
6
25
|
display: flex;
|
|
7
26
|
justify-content: center;
|
|
8
27
|
align-items: center;
|
|
@@ -22,12 +41,13 @@
|
|
|
22
41
|
.connector {
|
|
23
42
|
width: min(400px, 100dvw);
|
|
24
43
|
height: 500px;
|
|
25
|
-
background-color: var(--
|
|
44
|
+
background-color: var(--background_wagmi_34535);
|
|
26
45
|
position: fixed;
|
|
27
|
-
|
|
46
|
+
box-shadow: 0 0 1rem 0.3rem var(--meduim_dark_wagmi_34535);
|
|
28
47
|
flex-flow: column;
|
|
29
48
|
overflow: hidden;
|
|
30
49
|
animation: fadeIn 0.5s ease forwards;
|
|
50
|
+
border-radius: 15px;
|
|
31
51
|
}
|
|
32
52
|
.connector div {
|
|
33
53
|
flex-flow: column;
|
|
@@ -43,22 +63,21 @@
|
|
|
43
63
|
@keyframes fadeIn {
|
|
44
64
|
from {
|
|
45
65
|
opacity: 0;
|
|
46
|
-
transform:
|
|
66
|
+
transform: translateY(10%);
|
|
47
67
|
}
|
|
48
68
|
to {
|
|
49
69
|
opacity: 1;
|
|
50
|
-
transform:
|
|
70
|
+
transform: translateY(0);
|
|
51
71
|
}
|
|
52
72
|
}
|
|
53
73
|
.connector img {
|
|
54
|
-
margin:
|
|
55
|
-
filter: var(--invert-cordy-image);
|
|
74
|
+
margin: 0 0.3rem;
|
|
56
75
|
}
|
|
57
76
|
.connector button {
|
|
58
77
|
width: 300px;
|
|
59
78
|
padding: 1rem;
|
|
60
|
-
background-color: var(--
|
|
61
|
-
color: var(--
|
|
79
|
+
background-color: var(--foreground_wagmi_34535);
|
|
80
|
+
color: var(--background_wagmi_34535);
|
|
62
81
|
font-weight: bold;
|
|
63
82
|
cursor: pointer;
|
|
64
83
|
border: transparent;
|
|
@@ -72,6 +91,7 @@
|
|
|
72
91
|
.connector button:active {
|
|
73
92
|
transform: scale(0.5);
|
|
74
93
|
}
|
|
94
|
+
|
|
75
95
|
.info span {
|
|
76
96
|
flex-flow: column;
|
|
77
97
|
}
|
|
@@ -84,16 +104,24 @@
|
|
|
84
104
|
font-weight: bolder;
|
|
85
105
|
}
|
|
86
106
|
.closed {
|
|
87
|
-
padding:
|
|
107
|
+
padding: 0.5rem 0.8rem;
|
|
88
108
|
position: absolute;
|
|
89
109
|
top: 0;
|
|
90
110
|
right: 0;
|
|
91
111
|
font-weight: bolder;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
background-color: transparent;
|
|
92
114
|
cursor: pointer;
|
|
115
|
+
transition: all 0.5s ease;
|
|
116
|
+
}
|
|
117
|
+
.closed:hover {
|
|
118
|
+
background-color: var(--meduim_dark_wagmi_34535);
|
|
93
119
|
}
|
|
94
120
|
@media (max-width: 800px) {
|
|
95
121
|
.connector {
|
|
96
122
|
bottom: 0;
|
|
123
|
+
border-bottom-right-radius: 0;
|
|
124
|
+
border-bottom-left-radius: 0;
|
|
97
125
|
}
|
|
98
126
|
}
|
|
99
127
|
|
package/dist/css/index.d.ts
CHANGED
package/dist/css/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../css/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../css/index.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EACH,YAAY,EACf,CAAC"}
|
package/dist/css/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ProvidersClientWrapper } from "./client__provider";
|
|
2
2
|
export { default as getConfig } from "./config/walletConfig";
|
|
3
|
+
export { useWalletModal } from "./wagmi__providers";
|
|
3
4
|
export * from "./components";
|
|
4
5
|
export * from "./controllers";
|
|
5
6
|
//# 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":"AAEA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG7D,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGvE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export { default as ProvidersClientWrapper } from "./client__provider";
|
|
3
3
|
// Config
|
|
4
4
|
export { default as getConfig } from "./config/walletConfig";
|
|
5
|
+
// Hooks
|
|
6
|
+
export { useWalletModal } from "./wagmi__providers";
|
|
5
7
|
//Components
|
|
6
8
|
export * from "./components";
|
|
7
9
|
//Controllers
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cordystackx/cordy_minikit",
|
|
3
|
+
"version": "1.2.4",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"description": "Cordy Minikit - Open Source Web3 Dev Toolkit (Wallet Connect, Tx, Disconnect, Dashboard)",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && pnpm run copy-css",
|
|
16
|
+
"copy-css": "mkdir -p dist/css/UI_Comp && cp css/UI_Comp/styles.module.css dist/css/UI_Comp/",
|
|
17
|
+
"release": "pnpm publish --access public"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"web3",
|
|
21
|
+
"nextjs",
|
|
22
|
+
"react",
|
|
23
|
+
"wagmi",
|
|
24
|
+
"viem",
|
|
25
|
+
"ethers",
|
|
26
|
+
"blockchain",
|
|
27
|
+
"wallet-connect",
|
|
28
|
+
"npm-package",
|
|
29
|
+
"cordy-minikit"
|
|
30
|
+
],
|
|
31
|
+
"author": "Marc Giestin Louis Cordova",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@coinbase/wallet-sdk": "4.3.7",
|
|
35
|
+
"@tanstack/react-query": "^5.90.3",
|
|
36
|
+
"ethers": "^6.15.0",
|
|
37
|
+
"next": "^14.2.33",
|
|
38
|
+
"react": "^18.3.1",
|
|
39
|
+
"react-dom": "^18.3.1",
|
|
40
|
+
"react-icons": "^5.5.0",
|
|
41
|
+
"wagmi": "^2.18.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/node": "^20.19.21",
|
|
45
|
+
"@types/react": "^18.3.26",
|
|
46
|
+
"@types/react-dom": "^18.3.7"
|
|
47
|
+
}
|
|
48
|
+
}
|