@cordystackx/cordy_minikit 0.1.7 → 0.1.8
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/package.json +7 -1
- package/chains/base__sepolia.ts +0 -34
- package/chains/core.ts +0 -31
- package/chains/index.ts +0 -6
- package/config/ERC20_ABI.json +0 -26
- package/config/Image.json +0 -3
- package/config/walletConfig.ts +0 -18
- package/css/Buttons/styles.module.css +0 -40
- package/css/UI_Comp/styles.module.css +0 -99
- package/css/index.ts +0 -9
- package/wagmi__providers.tsx +0 -41
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cordystackx/cordy_minikit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"main": "index.ts",
|
|
5
|
+
"files": [
|
|
6
|
+
"index.ts",
|
|
7
|
+
"client__provider.tsx",
|
|
8
|
+
"components",
|
|
9
|
+
"controllers"
|
|
10
|
+
],
|
|
5
11
|
"peerDependencies": {
|
|
6
12
|
"react": ">=19",
|
|
7
13
|
"wagmi": ">=2",
|
package/chains/base__sepolia.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defineChain } from "viem";
|
|
2
|
-
|
|
3
|
-
export default function BaseSepolia() {
|
|
4
|
-
const baseSepolia = defineChain({
|
|
5
|
-
id: 84532,
|
|
6
|
-
name: 'Base Sepolia',
|
|
7
|
-
network: 'base-sepolia',
|
|
8
|
-
nativeCurrency: {
|
|
9
|
-
name: 'Base Sepolia Ether',
|
|
10
|
-
symbol: 'ETH',
|
|
11
|
-
decimals: 18,
|
|
12
|
-
},
|
|
13
|
-
rpcUrls: {
|
|
14
|
-
default: {
|
|
15
|
-
http: [
|
|
16
|
-
process.env.NEXT_PUBLIC_LINK_PROJECT_ID_SEPOLIA || "",
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
public: {
|
|
20
|
-
http: [
|
|
21
|
-
process.env.NEXT_PUBLIC_LINK_PROJECT_ID_SEPOLIA || "",
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
blockExplorers: {
|
|
26
|
-
default: { name: 'Basescan', url: 'https://sepolia.basescan.org' },
|
|
27
|
-
},
|
|
28
|
-
testnet: true,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return baseSepolia;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
package/chains/core.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineChain } from "viem";
|
|
2
|
-
|
|
3
|
-
export default function CoreTestnet() {
|
|
4
|
-
// Custom Chain
|
|
5
|
-
const coreTestnet = defineChain({
|
|
6
|
-
id: 1114,
|
|
7
|
-
name: 'tCORE2',
|
|
8
|
-
network: 'core-testnet',
|
|
9
|
-
nativeCurrency: {
|
|
10
|
-
name: 'tCORE2',
|
|
11
|
-
symbol: 'tCORE2',
|
|
12
|
-
decimals: 18,
|
|
13
|
-
},
|
|
14
|
-
rpcUrls: {
|
|
15
|
-
default: {
|
|
16
|
-
http: ['https://rpc.test2.btcs.network'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
blockExplorers: {
|
|
20
|
-
default: {
|
|
21
|
-
name: 'CoreScan',
|
|
22
|
-
url: 'https://scan.test2.btcs.network',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
testnet: true,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return coreTestnet;
|
|
30
|
-
|
|
31
|
-
}
|
package/chains/index.ts
DELETED
package/config/ERC20_ABI.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"constant": true,
|
|
4
|
-
"inputs": [{ "name": "owner", "type": "address" }],
|
|
5
|
-
"name": "balanceOf",
|
|
6
|
-
"outputs": [{ "name": "balance", "type": "uint256" }],
|
|
7
|
-
"type": "function"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"constant": false,
|
|
11
|
-
"inputs": [
|
|
12
|
-
{ "name": "to", "type": "address" },
|
|
13
|
-
{ "name": "value", "type": "uint256" }
|
|
14
|
-
],
|
|
15
|
-
"name": "transfer",
|
|
16
|
-
"outputs": [{ "name": "", "type": "bool" }],
|
|
17
|
-
"type": "function"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"constant": true,
|
|
21
|
-
"inputs": [],
|
|
22
|
-
"name": "decimals",
|
|
23
|
-
"outputs": [{ "name": "", "type": "uint8" }],
|
|
24
|
-
"type": "function"
|
|
25
|
-
}
|
|
26
|
-
]
|
package/config/Image.json
DELETED
package/config/walletConfig.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { http, createConfig } from 'wagmi';
|
|
2
|
-
import { mainnet, base } from 'wagmi/chains';
|
|
3
|
-
import { walletConnect } from 'wagmi/connectors';
|
|
4
|
-
import { BaseSepolia } from "../chains";
|
|
5
|
-
|
|
6
|
-
const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID!;
|
|
7
|
-
|
|
8
|
-
export const config = createConfig({
|
|
9
|
-
chains: [mainnet, base, BaseSepolia()],
|
|
10
|
-
connectors: [
|
|
11
|
-
walletConnect({ projectId })
|
|
12
|
-
],
|
|
13
|
-
transports: {
|
|
14
|
-
[mainnet.id]: http(),
|
|
15
|
-
[base.id]: http(),
|
|
16
|
-
[BaseSepolia().id]: http()
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
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
|
-
|
package/css/index.ts
DELETED
package/wagmi__providers.tsx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { createContext, useContext, useState, ReactNode } from "react";
|
|
3
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
import { WagmiProvider } from "wagmi";
|
|
5
|
-
import { config } from "./config/walletConfig";
|
|
6
|
-
import { UI_Comp } from "./components";
|
|
7
|
-
|
|
8
|
-
type WalletContextType = {
|
|
9
|
-
openModal: () => void;
|
|
10
|
-
closeModal: () => void;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const WalletContext = createContext<WalletContextType | null>(null);
|
|
14
|
-
|
|
15
|
-
const queryClient = new QueryClient();
|
|
16
|
-
|
|
17
|
-
export default function WalletProviders({ children }: { children: ReactNode }) {
|
|
18
|
-
const [open, setOpen] = useState(false);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<WagmiProvider config={config}>
|
|
22
|
-
<QueryClientProvider client={queryClient}>
|
|
23
|
-
<WalletContext.Provider
|
|
24
|
-
value={{
|
|
25
|
-
openModal: () => setOpen(true),
|
|
26
|
-
closeModal: () => setOpen(false),
|
|
27
|
-
}}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
{open && <UI_Comp />} {/* show modal only when open */}
|
|
31
|
-
</WalletContext.Provider>
|
|
32
|
-
</QueryClientProvider>
|
|
33
|
-
</WagmiProvider>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function useWalletModal() {
|
|
38
|
-
const ctx = useContext(WalletContext);
|
|
39
|
-
if (!ctx) throw new Error("Wrap in <WalletProviders>");
|
|
40
|
-
return ctx;
|
|
41
|
-
}
|