create-stylus 0.1.5 → 0.1.6

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 (36) hide show
  1. package/dist/cli.js +7 -8
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +1 -1
  4. package/src/main.ts +2 -4
  5. package/src/tasks/copy-template-files.ts +7 -4
  6. package/src/utils/prompt-for-missing-options.ts +1 -1
  7. package/templates/base/package.json +1 -1
  8. package/templates/base/packages/nextjs/app/debug/_components/contract/ContractUI.tsx +2 -2
  9. package/templates/base/packages/nextjs/app/debug/_components/contract/WriteOnlyFunctionForm.tsx +8 -4
  10. package/templates/base/packages/nextjs/components/scaffold-eth/Input/AddressInput.tsx +1 -9
  11. package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AddressInfoDropdown.tsx +138 -24
  12. package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/RevealBurnerPKModal.tsx +59 -0
  13. package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/index.tsx +3 -2
  14. package/templates/base/packages/nextjs/contracts/deployedContracts.ts +117 -1
  15. package/templates/base/packages/nextjs/hooks/scaffold-eth/useScaffoldEventHistory.ts +107 -28
  16. package/templates/base/packages/nextjs/hooks/scaffold-eth/useScaffoldWriteContract.ts +5 -1
  17. package/templates/base/packages/nextjs/hooks/scaffold-eth/useTransactor.tsx +7 -5
  18. package/templates/base/packages/nextjs/icons/LightBugAntIcon.tsx +7 -7
  19. package/templates/base/packages/nextjs/package.json +4 -5
  20. package/templates/base/packages/nextjs/services/web3/wagmiConnectors.tsx +1 -0
  21. package/templates/base/packages/nextjs/styles/globals.css +28 -22
  22. package/templates/base/packages/nextjs/tailwind.config.js +1 -1
  23. package/templates/base/packages/nextjs/utils/scaffold-eth/contract.ts +74 -2
  24. package/templates/base/packages/stylus/scripts/deploy.ts +0 -8
  25. package/templates/base/packages/stylus/your-contract/Cargo.lock +4 -4
  26. package/templates/base/packages/stylus/your-contract/Cargo.toml +1 -1
  27. package/templates/base/packages/stylus/your-contract/src/lib.rs +3 -7
  28. package/templates/base/readme.md +55 -169
  29. package/templates/base/yarn.lock +239 -297
  30. package/templates/base/packages/nextjs/components/scaffold-eth/RainbowKitCustomConnectButton/AngularWalletAddress.tsx +0 -223
  31. package/templates/base/packages/stylus/counter/.cargo/config.toml +0 -18
  32. package/templates/base/packages/stylus/counter/Cargo.lock +0 -5788
  33. package/templates/base/packages/stylus/counter/Cargo.toml +0 -46
  34. package/templates/base/packages/stylus/counter/rust-toolchain.toml +0 -2
  35. package/templates/base/packages/stylus/counter/src/lib.rs +0 -121
  36. package/templates/base/packages/stylus/counter/src/main.rs +0 -10
@@ -1,223 +0,0 @@
1
- import { useRef, useState } from "react";
2
- import { getAddress } from "viem";
3
- import { Address } from "viem";
4
- import { useDisconnect } from "wagmi";
5
- import {
6
- ArrowLeftEndOnRectangleIcon,
7
- ArrowsRightLeftIcon,
8
- CheckCircleIcon,
9
- ChevronDownIcon,
10
- DocumentDuplicateIcon,
11
- QrCodeIcon,
12
- UserCircleIcon,
13
- } from "@heroicons/react/24/outline";
14
- import { BlockieAvatar, isENS } from "~~/components/scaffold-eth";
15
- import { useCopyToClipboard, useOutsideClick } from "~~/hooks/scaffold-eth";
16
- import { getTargetNetworks } from "~~/utils/scaffold-stylus";
17
- import { arbitrumNitro } from "~~/utils/scaffold-stylus/supportedChains";
18
- import { useTheme } from "next-themes";
19
-
20
- const allowedNetworks = getTargetNetworks();
21
-
22
- type AngularWalletAddressProps = {
23
- address: Address;
24
- displayName: string;
25
- ensAvatar?: string;
26
- onSwitchAccount: () => void;
27
- };
28
-
29
- export const AngularWalletAddress = ({
30
- address,
31
- ensAvatar,
32
- displayName,
33
- onSwitchAccount,
34
- }: AngularWalletAddressProps) => {
35
- const { disconnect } = useDisconnect();
36
- const checkSumAddress = getAddress(address);
37
- const { resolvedTheme } = useTheme();
38
- const isDarkMode = resolvedTheme === "dark";
39
-
40
- const { copyToClipboard: copyAddressToClipboard, isCopiedToClipboard: isAddressCopiedToClipboard } =
41
- useCopyToClipboard();
42
- const [selectingNetwork, setSelectingNetwork] = useState(false);
43
- const dropdownRef = useRef<HTMLDetailsElement>(null);
44
-
45
- const closeDropdown = () => {
46
- setSelectingNetwork(false);
47
- dropdownRef.current?.removeAttribute("open");
48
- };
49
-
50
- useOutsideClick(dropdownRef, closeDropdown);
51
-
52
- return (
53
- <>
54
- <details ref={dropdownRef} className="dropdown dropdown-end leading-3">
55
- <summary
56
- tabIndex={0}
57
- className="dropdown-toggle gap-0 !h-auto"
58
- style={{
59
- position: "relative",
60
- width: "220px",
61
- height: "46px",
62
- display: "flex",
63
- alignItems: "center",
64
- padding: "0 20px",
65
- cursor: "pointer",
66
- alignSelf: "center",
67
- }}
68
- >
69
- {/* Angular border SVG */}
70
- <svg
71
- xmlns="http://www.w3.org/2000/svg"
72
- width="220"
73
- height="46"
74
- viewBox="0 0 220 46"
75
- fill="none"
76
- style={{
77
- position: "absolute",
78
- top: "-7px",
79
- left: 0,
80
- pointerEvents: "none",
81
- }}
82
- >
83
- <path
84
- d="M196.132 0.5L219.5 23.2109V45.5H24.0811L0.5 22.7871V0.5H196.132Z"
85
- stroke="#30B4ED"
86
- strokeWidth="1"
87
- />
88
- </svg>
89
-
90
- {/* Content */}
91
- <div
92
- style={{
93
- display: "flex",
94
- alignItems: "center",
95
- gap: "8px",
96
- width: "100%",
97
- height: "100%",
98
- zIndex: 1,
99
- position: "relative",
100
- }}
101
- >
102
- <BlockieAvatar address={checkSumAddress} size={30} ensImage={ensAvatar} />
103
- <span
104
- style={{
105
- color: isDarkMode ? "#FFF" : "black",
106
- fontFamily: "Orbitron, sans-serif",
107
- fontSize: "14px",
108
- fontWeight: 700,
109
- lineHeight: "1",
110
- textTransform: "uppercase",
111
- display: "flex",
112
- alignItems: "center",
113
- height: "30px",
114
- whiteSpace: "nowrap",
115
- minWidth: 0,
116
- }}
117
- >
118
- {isENS(displayName) ? displayName : checkSumAddress?.slice(0, 6) + "..." + checkSumAddress?.slice(-4)}
119
- </span>
120
- <ChevronDownIcon
121
- className="h-4 w-4"
122
- style={{
123
- color: isDarkMode ? "#FFF" : "black",
124
- height: "16px",
125
- width: "16px",
126
- }}
127
- />
128
- </div>
129
- </summary>
130
- <ul
131
- tabIndex={0}
132
- className="dropdown-content menu z-[2] p-2 mt-4 gap-1"
133
- style={{
134
- borderRadius: "8px",
135
- border: isDarkMode ? "1px solid rgba(255, 255, 255, 0.20)" : "1px solid rgba(0, 0, 0, 0.1)",
136
- background: isDarkMode ? "rgba(2, 2, 2, 0.20)" : "rgba(255, 255, 255, 0.20)",
137
- backdropFilter: "blur(25px)",
138
- }}
139
- >
140
- <li className={selectingNetwork ? "hidden" : ""}>
141
- <div
142
- className="flex gap-3 py-3 px-3 cursor-pointer rounded-lg transition-all duration-200 hover:bg-gradient-to-r hover:from-[rgba(48,180,237,0.16)] hover:to-[rgba(227,6,110,0.16)]"
143
- onClick={() => copyAddressToClipboard(checkSumAddress)}
144
- >
145
- {isAddressCopiedToClipboard ? (
146
- <>
147
- <CheckCircleIcon
148
- className="h-5 w-5"
149
- style={{ color: isDarkMode ? "white" : "black" }}
150
- aria-hidden="true"
151
- />
152
- <span className="whitespace-nowrap" style={{ color: isDarkMode ? "white" : "black" }}>
153
- Copied!
154
- </span>
155
- </>
156
- ) : (
157
- <>
158
- <DocumentDuplicateIcon
159
- className="h-5 w-5"
160
- style={{ color: isDarkMode ? "white" : "black" }}
161
- aria-hidden="true"
162
- />
163
- <span className="whitespace-nowrap" style={{ color: isDarkMode ? "white" : "black" }}>
164
- Copy address
165
- </span>
166
- </>
167
- )}
168
- </div>
169
- </li>
170
- <li className={selectingNetwork ? "hidden" : ""}>
171
- <label
172
- htmlFor="qrcode-modal"
173
- className="flex gap-3 py-3 px-3 cursor-pointer rounded-lg transition-all duration-200 hover:bg-gradient-to-r hover:from-[rgba(48,180,237,0.16)] hover:to-[rgba(227,6,110,0.16)]"
174
- >
175
- <QrCodeIcon className="h-5 w-5" style={{ color: isDarkMode ? "white" : "black" }} />
176
- <span className="whitespace-nowrap" style={{ color: isDarkMode ? "white" : "black" }}>
177
- View QR Code
178
- </span>
179
- </label>
180
- </li>
181
- {allowedNetworks.some(network => network.id === arbitrumNitro.id) && (
182
- <li className={selectingNetwork ? "hidden" : ""}>
183
- <button
184
- className="flex gap-3 py-3 px-3 cursor-pointer rounded-lg transition-all duration-200 hover:bg-gradient-to-r hover:from-[rgba(48,180,237,0.16)] hover:to-[rgba(227,6,110,0.16)] w-full text-left"
185
- type="button"
186
- onClick={onSwitchAccount}
187
- >
188
- <UserCircleIcon className="h-5 w-5" style={{ color: isDarkMode ? "white" : "black" }} />
189
- <span className="whitespace-nowrap" style={{ color: isDarkMode ? "white" : "black" }}>
190
- Switch account
191
- </span>
192
- </button>
193
- </li>
194
- )}
195
- {allowedNetworks.length > 1 ? (
196
- <li className={selectingNetwork ? "hidden" : ""}>
197
- <button
198
- className="flex gap-3 py-3 px-3 cursor-pointer rounded-lg transition-all duration-200 hover:bg-gradient-to-r hover:from-[rgba(48,180,237,0.16)] hover:to-[rgba(227,6,110,0.16)] w-full text-left"
199
- type="button"
200
- onClick={() => {
201
- setSelectingNetwork(true);
202
- }}
203
- >
204
- <ArrowsRightLeftIcon className="h-5 w-5" style={{ color: isDarkMode ? "white" : "black" }} />
205
- <span style={{ color: isDarkMode ? "white" : "black" }}>Switch Network</span>
206
- </button>
207
- </li>
208
- ) : null}
209
- <li className={selectingNetwork ? "hidden" : ""}>
210
- <button
211
- className="flex gap-3 py-3 px-3 cursor-pointer rounded-lg transition-all duration-200 hover:bg-gradient-to-r hover:from-[rgba(48,180,237,0.16)] hover:to-[rgba(227,6,110,0.16)] w-full text-left"
212
- type="button"
213
- onClick={() => disconnect()}
214
- >
215
- <ArrowLeftEndOnRectangleIcon className="h-5 w-5" style={{ color: "#FB3748" }} />
216
- <span style={{ color: "#FB3748" }}>Disconnect</span>
217
- </button>
218
- </li>
219
- </ul>
220
- </details>
221
- </>
222
- );
223
- };
@@ -1,18 +0,0 @@
1
- [target.wasm32-unknown-unknown]
2
- rustflags = [
3
- "-C", "link-arg=-zstack-size=32768",
4
- "-C", "target-feature=-reference-types",
5
- "-C", "target-feature=+bulk-memory",
6
- ]
7
-
8
- [target.aarch64-apple-darwin]
9
- rustflags = [
10
- "-C", "link-arg=-undefined",
11
- "-C", "link-arg=dynamic_lookup",
12
- ]
13
-
14
- [target.x86_64-apple-darwin]
15
- rustflags = [
16
- "-C", "link-arg=-undefined",
17
- "-C", "link-arg=dynamic_lookup",
18
- ]