@cordystackx/cordy_minikit 0.3.3 → 0.3.5

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.
Files changed (29) hide show
  1. package/dist/client__provider.d.ts +1 -1
  2. package/dist/client__provider.d.ts.map +1 -1
  3. package/dist/{client__provider.jsx → client__provider.js} +2 -1
  4. package/dist/components/Connect_wallet_bt.d.ts +1 -1
  5. package/dist/components/Connect_wallet_bt.d.ts.map +1 -1
  6. package/dist/components/{Connect_wallet_bt.jsx → Connect_wallet_bt.js} +2 -3
  7. package/dist/components/UI_Comp.d.ts +1 -1
  8. package/dist/components/UI_Comp.d.ts.map +1 -1
  9. package/dist/components/UI_Comp.js +36 -0
  10. package/dist/controllers/Disconnect.d.ts +1 -1
  11. package/dist/controllers/Disconnect.d.ts.map +1 -1
  12. package/dist/controllers/Disconnect.js +6 -0
  13. package/dist/controllers/Get_Balance.d.ts.map +1 -1
  14. package/dist/controllers/Transactions.d.ts +1 -1
  15. package/dist/controllers/Transactions.d.ts.map +1 -1
  16. package/dist/controllers/WagmiButton.d.ts +2 -3
  17. package/dist/controllers/WagmiButton.d.ts.map +1 -1
  18. package/dist/controllers/{WagmiButton.jsx → WagmiButton.js} +7 -10
  19. package/dist/css/Buttons/styles.module.css +40 -0
  20. package/dist/css/UI_Comp/styles.module.css +99 -0
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/dist/wagmi__providers.d.ts +1 -1
  23. package/dist/wagmi__providers.d.ts.map +1 -1
  24. package/dist/{wagmi__providers.jsx → wagmi__providers.js} +5 -11
  25. package/package.json +4 -4
  26. package/dist/components/UI_Comp.jsx +0 -69
  27. package/dist/controllers/Disconnect.jsx +0 -5
  28. /package/dist/controllers/{Get_Balance.jsx → Get_Balance.js} +0 -0
  29. /package/dist/controllers/{Transactions.jsx → Transactions.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
  export default function ProvidersClientWrapper({ children }: {
3
3
  children: ReactNode;
4
- }): import("react").JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
5
  //# sourceMappingURL=client__provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client__provider.d.ts","sourceRoot":"","sources":["../client__provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEnF"}
1
+ {"version":3,"file":"client__provider.d.ts","sourceRoot":"","sources":["../client__provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlC,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAEnF"}
@@ -1,9 +1,10 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import dynamic from 'next/dynamic';
3
4
  // Dynamically import WalletProviders with SSR disabled
4
5
  const WalletProviders = dynamic(() => import('./wagmi__providers'), {
5
6
  ssr: false,
6
7
  });
7
8
  export default function ProvidersClientWrapper({ children }) {
8
- return <WalletProviders>{children}</WalletProviders>;
9
+ return _jsx(WalletProviders, { children: children });
9
10
  }
@@ -1,2 +1,2 @@
1
- export default function ConnectWalletBT(): import("react").JSX.Element;
1
+ export default function ConnectWalletBT(): import("react/jsx-runtime").JSX.Element;
2
2
  //# 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,gCAYtC"}
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,11 +1,10 @@
1
1
  "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { Buttons__css } from "../css";
3
4
  import { useWalletModal } from "../wagmi__providers";
4
5
  import { useAccount } from "wagmi";
5
6
  export default function ConnectWalletBT() {
6
7
  const { openModal } = useWalletModal();
7
8
  const { isConnected, address } = useAccount();
8
- return (<button className={Buttons__css.button__button} onClick={openModal}>
9
- {isConnected ? `Connected ${address}` : "Connect Wallet"}
10
- </button>);
9
+ return (_jsx("button", { className: Buttons__css.button__button, onClick: openModal, children: isConnected ? `Connected ${address}` : "Connect Wallet" }));
11
10
  }
@@ -1,2 +1,2 @@
1
- export default function UI_Comp(): import("react").JSX.Element;
1
+ export default function UI_Comp(): import("react/jsx-runtime").JSX.Element;
2
2
  //# sourceMappingURL=UI_Comp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,gCAmF9B"}
1
+ {"version":3,"file":"UI_Comp.d.ts","sourceRoot":"","sources":["../../components/UI_Comp.tsx"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,OAAO,4CAmF9B"}
@@ -0,0 +1,36 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Image__src from "../config/Image.json";
4
+ import { UI_Comp__css } from "../css";
5
+ import { WalletButton, Disconnect, getTokenBalance } from "../controllers";
6
+ import { useWalletModal } from "../wagmi__providers";
7
+ import { useAccount } from "wagmi";
8
+ import { FaUser } from 'react-icons/fa';
9
+ import { useState, useEffect } from "react";
10
+ export default function UI_Comp() {
11
+ const { closeModal } = useWalletModal();
12
+ const { isConnected, address } = useAccount();
13
+ const [loading, setLoading] = useState(false);
14
+ const [errorMsg, setErrorMsg] = useState();
15
+ const [balance, setBalance] = useState("");
16
+ useEffect(() => {
17
+ Get_Balance();
18
+ }, [balance]);
19
+ const Get_Balance = async () => {
20
+ if (!address || !process.env.NEXT_PUBLIC_TOKENADDRESS)
21
+ return;
22
+ const balance = await getTokenBalance(address, process.env.NEXT_PUBLIC_TOKENADDRESS);
23
+ setBalance(balance);
24
+ return;
25
+ };
26
+ if (isConnected) {
27
+ if (balance === "") {
28
+ Get_Balance();
29
+ }
30
+ 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), " ", process.env.NEXT_PUBLIC_SYMBOL] }), _jsx("p", { style: { color: "#ff0" }, children: address })] })) : (_jsx("p", { style: { color: "var(--foreground_wagmi)" }, children: "Loading balance..." })) })), _jsx(Disconnect, {}), _jsx("a", { href: "https://cordy-stack-x.vercel.app/", children: "Powered By CordyStackX" })] }) }));
31
+ }
32
+ 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 }) => {
33
+ setLoading(isPending);
34
+ setErrorMsg(error);
35
+ } }), _jsx("p", { children: errorMsg })] }), _jsx("a", { href: "https://cordy-stack-x.vercel.app/", children: "Powered By CordyStackX" })] }) }));
36
+ }
@@ -1,2 +1,2 @@
1
- export default function Disconnect(): import("react").JSX.Element;
1
+ export default function Disconnect(): import("react/jsx-runtime").JSX.Element;
2
2
  //# sourceMappingURL=Disconnect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Disconnect.d.ts","sourceRoot":"","sources":["../../controllers/Disconnect.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,UAAU,gCAMjC"}
1
+ {"version":3,"file":"Disconnect.d.ts","sourceRoot":"","sources":["../../controllers/Disconnect.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,UAAU,4CAMjC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useDisconnect } from 'wagmi';
3
+ export default function Disconnect() {
4
+ const { disconnect } = useDisconnect();
5
+ return (_jsx("button", { onClick: () => disconnect(), children: "Disconnect" }));
6
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Get_Balance.d.ts","sourceRoot":"","sources":["../../controllers/Get_Balance.tsx"],"names":[],"mappings":"AAGA,wBAA8B,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAcpG"}
1
+ {"version":3,"file":"Get_Balance.d.ts","sourceRoot":"","sources":["../../controllers/Get_Balance.tsx"],"names":[],"mappings":"AAGA,wBAA8B,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAclF"}
@@ -1,2 +1,2 @@
1
- export default function CordyStackTrans(address: string, cost: number | string): Promise<void>;
1
+ export default function CordyStackTrans(address: string, cost: number): Promise<void>;
2
2
  //# sourceMappingURL=Transactions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../controllers/Transactions.tsx"],"names":[],"mappings":"AAMA,wBAA8B,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,iBA4BnF"}
1
+ {"version":3,"file":"Transactions.d.ts","sourceRoot":"","sources":["../../controllers/Transactions.tsx"],"names":[],"mappings":"AAMA,wBAA8B,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBA4B1E"}
@@ -1,8 +1,7 @@
1
- import React from "react";
2
- export default function WalletButton({ onStatusChange, }: {
1
+ export default function WalletButton({ onStatusChange }: {
3
2
  onStatusChange?: (status: {
4
3
  isPending: boolean;
5
4
  error?: string;
6
5
  }) => void;
7
- }): React.JSX.Element;
6
+ }): import("react/jsx-runtime").JSX.Element;
8
7
  //# sourceMappingURL=WagmiButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WagmiButton.d.ts","sourceRoot":"","sources":["../../controllers/WagmiButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAIzC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,cAAc,GACf,EAAE;IACD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3E,qBAwCA"}
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,10 +1,11 @@
1
1
  "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import React, { useEffect } from "react";
3
4
  import { useConnect } from "wagmi";
4
- export default function WalletButton({ onStatusChange, }) {
5
+ export default function WalletButton({ onStatusChange }) {
5
6
  const { connectors, connectAsync, status } = useConnect();
6
7
  const [pendingConnector, setPendingConnector] = React.useState(null);
7
- const [errorMsg, setErrorMsg] = React.useState();
8
+ const [errorMsg, setErrorMsg] = React.useState(undefined);
8
9
  // Derived isPending (true/false only)
9
10
  const isPending = status === "pending";
10
11
  // Notify parent whenever status changes
@@ -16,8 +17,7 @@ export default function WalletButton({ onStatusChange, }) {
16
17
  });
17
18
  }
18
19
  }, [isPending, errorMsg, onStatusChange]);
19
- return (<>
20
- {connectors.map((connector) => (<WalletOption key={connector.uid} connector={connector} onClick={async () => {
20
+ return (_jsx(_Fragment, { children: connectors.map((connector) => (_jsx(WalletOption, { connector: connector, onClick: async () => {
21
21
  setPendingConnector(connector);
22
22
  setErrorMsg(undefined); // reset old errors
23
23
  try {
@@ -29,10 +29,9 @@ export default function WalletButton({ onStatusChange, }) {
29
29
  finally {
30
30
  setPendingConnector(null);
31
31
  }
32
- }} isPending={pendingConnector?.uid === connector.uid && isPending}/>))}
33
- </>);
32
+ }, isPending: pendingConnector?.uid === connector.uid && isPending }, connector.uid))) }));
34
33
  }
35
- function WalletOption({ connector, onClick, isPending, }) {
34
+ function WalletOption({ connector, onClick, isPending }) {
36
35
  const [ready, setReady] = React.useState(false);
37
36
  React.useEffect(() => {
38
37
  (async () => {
@@ -40,7 +39,5 @@ function WalletOption({ connector, onClick, isPending, }) {
40
39
  setReady(!!provider);
41
40
  })();
42
41
  }, [connector]);
43
- return (<button disabled={!ready || isPending} onClick={onClick}>
44
- {isPending ? "Connecting..." : connector.name}
45
- </button>);
42
+ return (_jsx("button", { disabled: !ready || isPending, onClick: onClick, children: isPending ? "Connecting..." : connector.name }));
46
43
  }
@@ -0,0 +1,40 @@
1
+ :root {
2
+ --foreground_wagmi: #171717;
3
+ --background_wagmi: #FAFAFA;
4
+ --invert-cordy-image: invert(1);
5
+ --invert-cordy-image_1: invert(0);
6
+ }
7
+
8
+ @media (prefers-color-scheme: dark) {
9
+ :root {
10
+ --foreground_wagmi: #ededed;
11
+ --background_wagmi: #121212;
12
+ --invert-cordy-image: invert(0);
13
+ --invert-cordy-image_1: invert(1);
14
+ }
15
+ }
16
+
17
+ .button__button {
18
+ width: 150px;
19
+ padding: 0.8rem;
20
+ background-color: var(--foreground_wagmi);
21
+ color: var(--background_wagmi);
22
+ font-weight: bold;
23
+ cursor: pointer;
24
+ border: transparent;
25
+ transition: all 0.5s ease-in-out;
26
+ overflow: hidden;
27
+ white-space: nowrap;
28
+ text-overflow: ellipsis;
29
+ text-align: center;
30
+ }
31
+ .button__button img {
32
+ filter: var(--invert-cordy-image_1);
33
+ }
34
+
35
+ .button__button:hover {
36
+ opacity: 0.5;
37
+ }
38
+ .button__button:active {
39
+ transform: scale(0.6);
40
+ }
@@ -0,0 +1,99 @@
1
+ .container,
2
+ .connector,
3
+ .connector div,
4
+ .info,
5
+ .info span {
6
+ display: flex;
7
+ justify-content: center;
8
+ align-items: center;
9
+ }
10
+
11
+ .container {
12
+ width: 100dvw;
13
+ height: 100dvh;
14
+ backdrop-filter: blur(10px);
15
+ z-index: 999;
16
+ position: fixed;
17
+ top: 50%;
18
+ left: 50%;
19
+ transform: translate(-50%, -50%);
20
+ }
21
+
22
+ .connector {
23
+ width: min(400px, 100dvw);
24
+ height: 500px;
25
+ background-color: var(--background_wagmi);
26
+ position: fixed;
27
+ border: 2px solid var(--foreground_wagmi);
28
+ flex-flow: column;
29
+ overflow: hidden;
30
+ animation: fadeIn 0.5s ease forwards;
31
+ }
32
+ .connector div {
33
+ flex-flow: column;
34
+ padding: 1rem 0;
35
+ width: 90%;
36
+ }
37
+
38
+ .connector div p {
39
+ color: #f00;
40
+ text-align: center;
41
+ }
42
+
43
+ @keyframes fadeIn {
44
+ from {
45
+ opacity: 0;
46
+ transform: scale(0.9);
47
+ }
48
+ to {
49
+ opacity: 1;
50
+ transform: scale(1);
51
+ }
52
+ }
53
+ .connector img {
54
+ margin: 1rem 0;
55
+ filter: var(--invert-cordy-image);
56
+ }
57
+ .connector button {
58
+ width: 300px;
59
+ padding: 1rem;
60
+ background-color: var(--foreground_wagmi);
61
+ color: var(--background_wagmi);
62
+ font-weight: bold;
63
+ cursor: pointer;
64
+ border: transparent;
65
+ transition: all 0.5s ease;
66
+ margin: 1rem 0;
67
+ transition: all 0.5s ease-in-out;
68
+ }
69
+ .connector button:hover {
70
+ opacity: 0.5;
71
+ }
72
+ .connector button:active {
73
+ transform: scale(0.5);
74
+ }
75
+ .info span {
76
+ flex-flow: column;
77
+ }
78
+ .info span p {
79
+ width: 80%;
80
+ overflow: hidden;
81
+ white-space: nowrap;
82
+ text-overflow: ellipsis;
83
+ margin: 1rem 0;
84
+ font-weight: bolder;
85
+ }
86
+ .closed {
87
+ padding: 1rem;
88
+ position: absolute;
89
+ top: 0;
90
+ right: 0;
91
+ font-weight: bolder;
92
+ cursor: pointer;
93
+ }
94
+ @media (max-width: 800px) {
95
+ .connector {
96
+ bottom: 0;
97
+ }
98
+ }
99
+