@medialane/ui 0.244.0 → 0.245.0

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.
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var coin_create_exports = {};
31
+ __export(coin_create_exports, {
32
+ CoinCreate: () => CoinCreate
33
+ });
34
+ module.exports = __toCommonJS(coin_create_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_lucide_react = require("lucide-react");
38
+ var import_sdk = require("@medialane/sdk");
39
+ var import_starknet = require("@medialane/sdk/starknet");
40
+ var import_image = __toESM(require("../image.js"), 1);
41
+ var import_link = __toESM(require("../link.js"), 1);
42
+ var import_input = require("../input.js");
43
+ var import_label = require("../label.js");
44
+ var import_textarea = require("../textarea.js");
45
+ var import_coin_launch_preview = require("../coin-launch-preview.js");
46
+ var import_currency_icon = require("../currency-icon.js");
47
+ var import_gradient_button = require("../gradient-button.js");
48
+ var import_claim_route_shell = require("../claim-route-shell.js");
49
+ var import_creation_success = require("../creation-success.js");
50
+ var import_transaction_dialog = require("../transaction-dialog.js");
51
+ var import_wallet_required = require("../wallet-required.js");
52
+ var import_medialane_app = require("../medialane-app.js");
53
+ var import_reward_earned = require("../rewards/reward-earned.js");
54
+ var import_cn = require("../../utils/cn.js");
55
+ var import_launchpad_defaults = require("../../utils/launchpad-defaults.js");
56
+ var import_run_intent_calls = require("../../utils/run-intent-calls.js");
57
+ var import_use_transaction = require("../../utils/use-transaction.js");
58
+ var import_use_launchpad_image_upload = require("../../utils/use-launchpad-image-upload.js");
59
+ var import_use_erc20_balance = require("../../utils/media-wallet/use-erc20-balance.js");
60
+ const QUOTE_OPTIONS = import_sdk.SUPPORTED_TOKENS.map((t) => t.symbol);
61
+ const SUPPLY_PRESETS = [
62
+ { label: "1M", value: "1000000" },
63
+ { label: "100M", value: "100000000" },
64
+ { label: "1B", value: "1000000000" }
65
+ ];
66
+ function CoinCreate({ aside, tradeHref }) {
67
+ const app = (0, import_medialane_app.useMedialaneApp)();
68
+ const walletAddress = app.walletAddress;
69
+ const tx = (0, import_use_transaction.useTransaction)();
70
+ const [name, setName] = (0, import_react.useState)("");
71
+ const [symbol, setSymbol] = (0, import_react.useState)("");
72
+ const [autoSymbol, setAutoSymbol] = (0, import_react.useState)("");
73
+ const [description, setDescription] = (0, import_react.useState)("");
74
+ const [supply, setSupply] = (0, import_react.useState)("");
75
+ const [quote, setQuote] = (0, import_react.useState)("STRK");
76
+ const [price, setPrice] = (0, import_react.useState)(String(import_starknet.SUGGESTED_DEFAULT_PRICE));
77
+ const [teamPct, setTeamPct] = (0, import_react.useState)(5);
78
+ const [coinAddress, setCoinAddress] = (0, import_react.useState)(null);
79
+ const [profileStatus, setProfileStatus] = (0, import_react.useState)("idle");
80
+ const upload = (0, import_use_launchpad_image_upload.useLaunchpadImageUpload)({ successMessage: "Image ready" });
81
+ const { imagePreview, imageUri, imageUploading, uploadError, uploadSuccess, fileInputRef, handleImageSelect, clearImage } = upload;
82
+ const quoteToken = (0, import_sdk.getTokenBySymbol)(quote);
83
+ const { rawBalance } = (0, import_use_erc20_balance.useTokenBalance)(quote, walletAddress ?? null);
84
+ const priceNum = Number(price);
85
+ const nameErr = name ? (0, import_starknet.validateCoinName)(name) : null;
86
+ const symErr = symbol ? (0, import_starknet.validateCoinSymbol)(symbol) : null;
87
+ const supplyErr = supply ? (0, import_starknet.validateCoinSupply)(supply) : null;
88
+ const priceErr = price ? (0, import_starknet.validatePrice)(quoteToken.decimals, priceNum) : "Price is required";
89
+ const identityValid = !(0, import_starknet.validateCoinName)(name) && !(0, import_starknet.validateCoinSymbol)(symbol);
90
+ const economicsValid = !(0, import_starknet.validateCoinSupply)(supply) && !priceErr;
91
+ const handleNameChange = (v) => {
92
+ setName(v);
93
+ const suggested = (0, import_launchpad_defaults.suggestLaunchpadSymbol)(v);
94
+ if (suggested && (!symbol || symbol === autoSymbol)) {
95
+ setSymbol(suggested);
96
+ setAutoSymbol(suggested);
97
+ }
98
+ };
99
+ const preview = (0, import_react.useMemo)(() => {
100
+ if ((0, import_starknet.validateCoinSupply)(supply) || (0, import_starknet.validatePrice)(quoteToken.decimals, priceNum)) return null;
101
+ const supplyHuman = Number(supply);
102
+ const supplyRaw = (0, import_starknet.coinToRaw)(BigInt(supply));
103
+ const teamRaw = (0, import_starknet.teamCoinsRaw)(supplyRaw, teamPct);
104
+ const buybackRaw = (0, import_starknet.buybackQuoteRaw)(teamRaw, priceNum, quoteToken.decimals);
105
+ return {
106
+ fdv: (0, import_starknet.fdvHuman)(supplyHuman, priceNum),
107
+ teamCoins: supplyHuman * (teamPct / 100),
108
+ buybackRaw,
109
+ buybackHuman: (0, import_sdk.formatAmount)(buybackRaw.toString(), quoteToken.decimals)
110
+ };
111
+ }, [supply, priceNum, teamPct, quoteToken.decimals]);
112
+ const insufficient = preview != null && rawBalance != null && rawBalance < preview.buybackRaw;
113
+ const canLaunch = identityValid && economicsValid && preview != null && teamPct > 0 && !insufficient && !imageUploading;
114
+ const previewData = {
115
+ name,
116
+ symbol,
117
+ description,
118
+ imageUrl: imagePreview,
119
+ supplyHuman: economicsValid && supply ? Number(supply) : null,
120
+ price: priceErr ? import_starknet.SUGGESTED_DEFAULT_PRICE : priceNum,
121
+ quoteSymbol: quote,
122
+ teamPct
123
+ };
124
+ const handleLaunchClick = () => {
125
+ if (!canLaunch || !walletAddress || !preview) return;
126
+ const owner = (0, import_sdk.normalizeAddress)("STARKNET", walletAddress);
127
+ const supplyRaw = (0, import_starknet.coinToRaw)(BigInt(supply));
128
+ const teamRaw = (0, import_starknet.teamCoinsRaw)(supplyRaw, teamPct);
129
+ const buybackRaw = (0, import_starknet.buybackQuoteRaw)(teamRaw, priceNum, quoteToken.decimals);
130
+ void tx.run(async (signer) => {
131
+ await app.ensureSignedIn?.();
132
+ const client = app.getClient();
133
+ const api = client.api;
134
+ const { txHash: deployHash } = await (0, import_run_intent_calls.runIntentCalls)(
135
+ signer,
136
+ () => api.intents.create("create-coin", { owner, name, symbol, initialSupply: supplyRaw.toString() })
137
+ );
138
+ const deployReceipt = await (0, import_starknet.assertTransactionSucceeded)(client.provider, deployHash);
139
+ const address = (0, import_starknet.parseCreatorCoinCreated)(deployReceipt);
140
+ await (0, import_run_intent_calls.runIntentCalls)(
141
+ signer,
142
+ () => api.intents.create("launch-coin", {
143
+ owner,
144
+ creatorCoin: address,
145
+ quoteToken: quoteToken.address,
146
+ price: priceNum,
147
+ initialHolders: teamPct > 0 ? [owner] : [],
148
+ initialHoldersAmounts: teamPct > 0 ? [teamRaw.toString()] : [],
149
+ transferRestrictionDelay: 0,
150
+ quoteFundAmount: buybackRaw.toString()
151
+ })
152
+ );
153
+ await api.coins.sync(address, owner).catch(() => {
154
+ });
155
+ setCoinAddress(address);
156
+ if (imageUri || description) {
157
+ setProfileStatus("saving");
158
+ await api.collections.updateProfile(address, { ...imageUri ? { image: imageUri } : {}, ...description ? { description } : {} }).then(() => setProfileStatus("saved")).catch(() => setProfileStatus("failed"));
159
+ }
160
+ });
161
+ };
162
+ const handleReset = () => {
163
+ tx.reset();
164
+ setCoinAddress(null);
165
+ setProfileStatus("idle");
166
+ setName("");
167
+ setSymbol("");
168
+ setAutoSymbol("");
169
+ setDescription("");
170
+ setSupply("");
171
+ setPrice(String(import_starknet.SUGGESTED_DEFAULT_PRICE));
172
+ setTeamPct(5);
173
+ clearImage();
174
+ };
175
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
176
+ import_wallet_required.WalletRequired,
177
+ {
178
+ icon: import_lucide_react.Coins,
179
+ iconClassName: "text-brand-orange",
180
+ title: "Launch a Creator Coin",
181
+ description: "Secure your account to design and launch your own coin with permanently-locked liquidity, in a few clicks.",
182
+ children: [
183
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_transaction_dialog.TransactionDialog, { tx, title: "Launch your coin", workingLabel: "Launching your coin\u2026", firstStepLabel: "Deploy your coin", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
184
+ import_creation_success.CreationSuccess,
185
+ {
186
+ name: name || "Your coin",
187
+ image: imagePreview,
188
+ caption: "Your coin is live",
189
+ primary: coinAddress ? { href: tradeHref(coinAddress), label: "View & trade your coin" } : { href: "/launchpad", label: "Back to Launchpad" },
190
+ secondary: coinAddress ? { href: "/launchpad", label: "Back to Launchpad" } : void 0,
191
+ onAgain: handleReset,
192
+ againLabel: "Launch another coin",
193
+ children: [
194
+ profileStatus === "saving" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-muted-foreground flex items-center justify-center gap-1.5", children: [
195
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-3 w-3 animate-spin" }),
196
+ " Saving your coin's image & description\u2026"
197
+ ] }),
198
+ profileStatus === "failed" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground text-center", children: "Couldn't save the image & description right now. Add them anytime from your collection settings." }),
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reward_earned.RewardEarned, { actionType: "launch_coin" })
200
+ ]
201
+ }
202
+ ) }),
203
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
204
+ import_claim_route_shell.ClaimRouteShell,
205
+ {
206
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Coins, { className: "h-4 w-4 text-white" }),
207
+ title: "Design your Creator Coin",
208
+ subtitle: "A few steps to design and launch your coin.",
209
+ aside: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_coin_launch_preview.CoinLaunchPreview, { data: previewData }),
211
+ aside
212
+ ] }),
213
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-7", children: [
214
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
215
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-lg font-bold", children: "Give it a face" }) }),
216
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
217
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { children: "Coin image" }),
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [
219
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
220
+ "button",
221
+ {
222
+ type: "button",
223
+ onClick: () => fileInputRef.current?.click(),
224
+ className: "relative h-24 w-24 shrink-0 rounded-full overflow-hidden border border-dashed border-border bg-muted/20 flex items-center justify-center",
225
+ children: [
226
+ imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_image.default, { src: imagePreview, alt: "Coin", fill: true, unoptimized: true, className: "object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ImagePlus, { className: "h-6 w-6 text-muted-foreground" }),
227
+ imageUploading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "absolute inset-0 bg-background/70 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 animate-spin text-primary" }) })
228
+ ]
229
+ }
230
+ ),
231
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1 text-xs text-muted-foreground", children: [
232
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "JPG, PNG, GIF, SVG or WebP" }),
233
+ imagePreview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", onClick: clearImage, className: "inline-flex items-center gap-1 text-muted-foreground active:text-foreground", children: [
234
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-3 w-3" }),
235
+ " Remove"
236
+ ] }),
237
+ uploadError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-destructive", children: uploadError }),
238
+ uploadSuccess && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-emerald-500", children: [
239
+ "\u2713 ",
240
+ uploadSuccess
241
+ ] })
242
+ ] }),
243
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
244
+ "input",
245
+ {
246
+ ref: fileInputRef,
247
+ type: "file",
248
+ accept: (0, import_sdk.acceptFor)("image"),
249
+ className: "hidden",
250
+ onChange: (e) => {
251
+ const f = e.target.files?.[0];
252
+ if (f) void handleImageSelect(f);
253
+ }
254
+ }
255
+ )
256
+ ] })
257
+ ] }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [
259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
260
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "name", children: "Name" }),
261
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { id: "name", value: name, onChange: (e) => handleNameChange(e.target.value), placeholder: "My Coin" }),
262
+ nameErr && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: nameErr })
263
+ ] }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
265
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "symbol", children: "Symbol" }),
266
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_input.Input, { id: "symbol", value: symbol, onChange: (e) => setSymbol(e.target.value.toUpperCase()), placeholder: "COIN" }),
267
+ symErr && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: symErr })
268
+ ] })
269
+ ] }),
270
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
271
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "description", children: "Description" }),
272
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
273
+ import_textarea.Textarea,
274
+ {
275
+ id: "description",
276
+ value: description,
277
+ onChange: (e) => setDescription(e.target.value.slice(0, 500)),
278
+ placeholder: "Tell your community what this coin is about\u2026",
279
+ rows: 3
280
+ }
281
+ )
282
+ ] })
283
+ ] }),
284
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px bg-border/60" }),
285
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "text-lg font-bold", children: "Set the numbers" }) }),
287
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { htmlFor: "supply", children: "Total supply" }),
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex gap-2 mb-1", children: SUPPLY_PRESETS.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
290
+ "button",
291
+ {
292
+ type: "button",
293
+ onClick: () => setSupply(p.value),
294
+ className: (0, import_cn.cn)(
295
+ "rounded-lg border px-3.5 py-1.5 text-sm font-medium",
296
+ supply === p.value ? "border-brand-orange bg-brand-orange/10 text-brand-orange" : "border-border text-muted-foreground"
297
+ ),
298
+ children: p.label
299
+ },
300
+ p.label
301
+ )) }),
302
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
303
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
304
+ import_input.Input,
305
+ {
306
+ id: "supply",
307
+ inputMode: "numeric",
308
+ value: supply ? Number(supply).toLocaleString() : "",
309
+ onChange: (e) => setSupply(e.target.value.replace(/[^\d]/g, "")),
310
+ placeholder: "1,000,000",
311
+ className: "pr-16 text-lg font-semibold tabular-nums"
312
+ }
313
+ ),
314
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground", children: "coins" })
315
+ ] }),
316
+ supplyErr && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: supplyErr })
317
+ ] }),
318
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_label.Label, { children: "Pair" }),
320
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex gap-2 flex-wrap", children: QUOTE_OPTIONS.map((q) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
321
+ "button",
322
+ {
323
+ type: "button",
324
+ onClick: () => setQuote(q),
325
+ className: (0, import_cn.cn)(
326
+ "inline-flex items-center gap-1.5 rounded-lg border px-3.5 py-1.5 text-sm font-medium",
327
+ quote === q ? "border-brand-maeve bg-brand-maeve/10 text-brand-maeve" : "border-border text-muted-foreground"
328
+ ),
329
+ children: [
330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: q, size: 16 }),
331
+ q
332
+ ]
333
+ },
334
+ q
335
+ )) })
336
+ ] }),
337
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
338
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { htmlFor: "price", children: [
339
+ "Price (",
340
+ quote,
341
+ " per coin)"
342
+ ] }),
343
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
344
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyIcon, { symbol: quote, size: 16 }) }),
345
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
346
+ import_input.Input,
347
+ {
348
+ id: "price",
349
+ inputMode: "decimal",
350
+ value: price,
351
+ onChange: (e) => setPrice(e.target.value.replace(/[^0-9.]/g, "")),
352
+ placeholder: String(import_starknet.SUGGESTED_DEFAULT_PRICE),
353
+ className: "pl-9"
354
+ }
355
+ )
356
+ ] }),
357
+ priceErr && price && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-destructive", children: priceErr })
358
+ ] }),
359
+ preview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-xl bg-muted/50 dark:bg-muted/30 p-4", children: [
360
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xs uppercase tracking-wide text-muted-foreground", children: "Starting market cap" }),
361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-2xl font-bold tabular-nums text-brand-maeve", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: preview.fdv.toLocaleString(), symbol: quote, iconSize: 18 }) })
362
+ ] }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1.5", children: [
364
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_label.Label, { htmlFor: "alloc", children: [
365
+ "Your allocation: ",
366
+ teamPct,
367
+ "%"
368
+ ] }),
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
370
+ "input",
371
+ {
372
+ id: "alloc",
373
+ type: "range",
374
+ min: 1,
375
+ max: 10,
376
+ step: 1,
377
+ value: teamPct,
378
+ onChange: (e) => setTeamPct(Number(e.target.value)),
379
+ className: "w-full accent-[hsl(var(--brand-orange))]"
380
+ }
381
+ ),
382
+ preview && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: (0, import_cn.cn)("text-sm font-semibold", insufficient ? "text-destructive" : "text-foreground"), children: [
383
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_currency_icon.CurrencyAmount, { amount: preview.buybackHuman, symbol: quote, iconSize: 14 }),
384
+ " required"
385
+ ] }),
386
+ insufficient && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-xs text-destructive", children: [
387
+ "Your wallet doesn't have enough ",
388
+ quote,
389
+ ". Add funds, or adjust the numbers above."
390
+ ] })
391
+ ] })
392
+ ] }),
393
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px bg-border/60" }),
394
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-4", children: [
395
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
396
+ import_gradient_button.GradientButton,
397
+ {
398
+ big: true,
399
+ onClick: handleLaunchClick,
400
+ disabled: !canLaunch || tx.phase !== "idle",
401
+ className: !canLaunch || tx.phase !== "idle" ? "opacity-40 pointer-events-none" : "",
402
+ children: tx.phase !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
403
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "h-4 w-4 mr-1.5 animate-spin" }),
404
+ " Launching\u2026"
405
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
406
+ "Launch your coin ",
407
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "h-4 w-4 ml-1.5" })
408
+ ] })
409
+ }
410
+ ),
411
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-muted-foreground text-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_link.default, { href: "/claim/memecoin", className: "underline active:text-foreground", children: "Already launched a coin? Claim it instead." }) })
412
+ ] })
413
+ ] })
414
+ }
415
+ )
416
+ ]
417
+ }
418
+ );
419
+ }
420
+ // Annotate the CommonJS export names for ESM import in node:
421
+ 0 && (module.exports = {
422
+ CoinCreate
423
+ });
424
+ //# sourceMappingURL=coin-create.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/launchpad/coin-create.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { ArrowRight, Coins, ImagePlus, Loader2, X } from \"lucide-react\";\nimport { SUPPORTED_TOKENS, acceptFor, formatAmount, getTokenBySymbol, normalizeAddress } from \"@medialane/sdk\";\nimport {\n SUGGESTED_DEFAULT_PRICE,\n buybackQuoteRaw,\n coinToRaw as toRaw,\n fdvHuman,\n parseCreatorCoinCreated,\n teamCoinsRaw,\n validateCoinName as validateName,\n validateCoinSupply as validateSupply,\n validateCoinSymbol as validateSymbol,\n validatePrice,\n assertTransactionSucceeded,\n type CreatorCoinReceiptLike,\n} from \"@medialane/sdk/starknet\";\nimport Image from \"../image.js\";\nimport Link from \"../link.js\";\nimport { Input } from \"../input.js\";\nimport { Label } from \"../label.js\";\nimport { Textarea } from \"../textarea.js\";\nimport { CoinLaunchPreview, type CoinPreviewData } from \"../coin-launch-preview.js\";\nimport { CurrencyAmount, CurrencyIcon } from \"../currency-icon.js\";\nimport { GradientButton } from \"../gradient-button.js\";\nimport { ClaimRouteShell } from \"../claim-route-shell.js\";\nimport { CreationSuccess } from \"../creation-success.js\";\nimport { TransactionDialog } from \"../transaction-dialog.js\";\nimport { WalletRequired } from \"../wallet-required.js\";\nimport { useMedialaneApp } from \"../medialane-app.js\";\nimport { RewardEarned } from \"../rewards/reward-earned.js\";\nimport { cn } from \"../../utils/cn.js\";\nimport { suggestLaunchpadSymbol } from \"../../utils/launchpad-defaults.js\";\nimport { runIntentCalls } from \"../../utils/run-intent-calls.js\";\nimport { useTransaction } from \"../../utils/use-transaction.js\";\nimport { useLaunchpadImageUpload } from \"../../utils/use-launchpad-image-upload.js\";\nimport { useTokenBalance } from \"../../utils/media-wallet/use-erc20-balance.js\";\n\nconst QUOTE_OPTIONS = SUPPORTED_TOKENS.map((t) => t.symbol);\ntype Quote = (typeof QUOTE_OPTIONS)[number];\n\nconst SUPPLY_PRESETS = [\n { label: \"1M\", value: \"1000000\" },\n { label: \"100M\", value: \"100000000\" },\n { label: \"1B\", value: \"1000000000\" },\n];\n\ntype ProfileStatus = \"idle\" | \"saving\" | \"saved\" | \"failed\";\n\nexport interface CoinCreateProps {\n aside?: ReactNode;\n tradeHref: (coinAddress: string) => string;\n}\n\nexport function CoinCreate({ aside, tradeHref }: CoinCreateProps) {\n const app = useMedialaneApp();\n const walletAddress = app.walletAddress;\n const tx = useTransaction();\n const [name, setName] = useState(\"\");\n const [symbol, setSymbol] = useState(\"\");\n const [autoSymbol, setAutoSymbol] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [supply, setSupply] = useState(\"\");\n const [quote, setQuote] = useState<Quote>(\"STRK\");\n const [price, setPrice] = useState(String(SUGGESTED_DEFAULT_PRICE));\n const [teamPct, setTeamPct] = useState(5);\n const [coinAddress, setCoinAddress] = useState<string | null>(null);\n const [profileStatus, setProfileStatus] = useState<ProfileStatus>(\"idle\");\n\n const upload = useLaunchpadImageUpload({ successMessage: \"Image ready\" });\n const { imagePreview, imageUri, imageUploading, uploadError, uploadSuccess, fileInputRef, handleImageSelect, clearImage } = upload;\n\n const quoteToken = getTokenBySymbol(quote)!;\n const { rawBalance } = useTokenBalance(quote, walletAddress ?? null);\n\n const priceNum = Number(price);\n const nameErr = name ? validateName(name) : null;\n const symErr = symbol ? validateSymbol(symbol) : null;\n const supplyErr = supply ? validateSupply(supply) : null;\n const priceErr = price ? validatePrice(quoteToken.decimals, priceNum) : \"Price is required\";\n const identityValid = !validateName(name) && !validateSymbol(symbol);\n const economicsValid = !validateSupply(supply) && !priceErr;\n\n const handleNameChange = (v: string) => {\n setName(v);\n const suggested = suggestLaunchpadSymbol(v);\n if (suggested && (!symbol || symbol === autoSymbol)) {\n setSymbol(suggested);\n setAutoSymbol(suggested);\n }\n };\n\n const preview = useMemo(() => {\n if (validateSupply(supply) || validatePrice(quoteToken.decimals, priceNum)) return null;\n const supplyHuman = Number(supply);\n const supplyRaw = toRaw(BigInt(supply));\n const teamRaw = teamCoinsRaw(supplyRaw, teamPct);\n const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);\n return {\n fdv: fdvHuman(supplyHuman, priceNum),\n teamCoins: supplyHuman * (teamPct / 100),\n buybackRaw,\n buybackHuman: formatAmount(buybackRaw.toString(), quoteToken.decimals),\n };\n }, [supply, priceNum, teamPct, quoteToken.decimals]);\n\n const insufficient = preview != null && rawBalance != null && rawBalance < preview.buybackRaw;\n const canLaunch = identityValid && economicsValid && preview != null && teamPct > 0 && !insufficient && !imageUploading;\n\n const previewData: CoinPreviewData = {\n name,\n symbol,\n description,\n imageUrl: imagePreview,\n supplyHuman: economicsValid && supply ? Number(supply) : null,\n price: priceErr ? SUGGESTED_DEFAULT_PRICE : priceNum,\n quoteSymbol: quote,\n teamPct,\n };\n\n const handleLaunchClick = () => {\n if (!canLaunch || !walletAddress || !preview) return;\n const owner = normalizeAddress(\"STARKNET\", walletAddress);\n const supplyRaw = toRaw(BigInt(supply));\n const teamRaw = teamCoinsRaw(supplyRaw, teamPct);\n const buybackRaw = buybackQuoteRaw(teamRaw, priceNum, quoteToken.decimals);\n void tx.run(async (signer) => {\n await app.ensureSignedIn?.();\n const client = app.getClient();\n const api = client.api;\n\n const { txHash: deployHash } = await runIntentCalls(signer, () =>\n api.intents.create(\"create-coin\", { owner, name, symbol, initialSupply: supplyRaw.toString() }),\n );\n const deployReceipt = await assertTransactionSucceeded(client.provider, deployHash);\n const address = parseCreatorCoinCreated(deployReceipt as CreatorCoinReceiptLike);\n\n await runIntentCalls(signer, () =>\n api.intents.create(\"launch-coin\", {\n owner,\n creatorCoin: address,\n quoteToken: quoteToken.address,\n price: priceNum,\n initialHolders: teamPct > 0 ? [owner] : [],\n initialHoldersAmounts: teamPct > 0 ? [teamRaw.toString()] : [],\n transferRestrictionDelay: 0,\n quoteFundAmount: buybackRaw.toString(),\n }),\n );\n await api.coins.sync(address, owner).catch(() => {});\n setCoinAddress(address);\n\n if (imageUri || description) {\n setProfileStatus(\"saving\");\n await api.collections\n .updateProfile(address, { ...(imageUri ? { image: imageUri } : {}), ...(description ? { description } : {}) })\n .then(() => setProfileStatus(\"saved\"))\n .catch(() => setProfileStatus(\"failed\"));\n }\n });\n };\n\n const handleReset = () => {\n tx.reset();\n setCoinAddress(null);\n setProfileStatus(\"idle\");\n setName(\"\");\n setSymbol(\"\");\n setAutoSymbol(\"\");\n setDescription(\"\");\n setSupply(\"\");\n setPrice(String(SUGGESTED_DEFAULT_PRICE));\n setTeamPct(5);\n clearImage();\n };\n\n return (\n <WalletRequired\n icon={Coins}\n iconClassName=\"text-brand-orange\"\n title=\"Launch a Creator Coin\"\n description=\"Secure your account to design and launch your own coin with permanently-locked liquidity, in a few clicks.\"\n >\n <TransactionDialog tx={tx} title=\"Launch your coin\" workingLabel=\"Launching your coin…\" firstStepLabel=\"Deploy your coin\">\n <CreationSuccess\n name={name || \"Your coin\"}\n image={imagePreview}\n caption=\"Your coin is live\"\n primary={coinAddress ? { href: tradeHref(coinAddress), label: \"View & trade your coin\" } : { href: \"/launchpad\", label: \"Back to Launchpad\" }}\n secondary={coinAddress ? { href: \"/launchpad\", label: \"Back to Launchpad\" } : undefined}\n onAgain={handleReset}\n againLabel=\"Launch another coin\"\n >\n {profileStatus === \"saving\" && (\n <p className=\"text-xs text-muted-foreground flex items-center justify-center gap-1.5\">\n <Loader2 className=\"h-3 w-3 animate-spin\" /> Saving your coin&apos;s image &amp; description…\n </p>\n )}\n {profileStatus === \"failed\" && (\n <p className=\"text-xs text-muted-foreground text-center\">\n Couldn&apos;t save the image &amp; description right now. Add them anytime from your collection settings.\n </p>\n )}\n <RewardEarned actionType=\"launch_coin\" />\n </CreationSuccess>\n </TransactionDialog>\n\n <ClaimRouteShell\n icon={<Coins className=\"h-4 w-4 text-white\" />}\n title=\"Design your Creator Coin\"\n subtitle=\"A few steps to design and launch your coin.\"\n aside={\n <>\n <CoinLaunchPreview data={previewData} />\n {aside}\n </>\n }\n >\n <div className=\"space-y-7\">\n\n <section className=\"space-y-4\">\n <div>\n <h3 className=\"text-lg font-bold\">Give it a face</h3>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label>Coin image</Label>\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => fileInputRef.current?.click()}\n className=\"relative h-24 w-24 shrink-0 rounded-full overflow-hidden border border-dashed border-border bg-muted/20 flex items-center justify-center\"\n >\n {imagePreview ? (\n\n <Image src={imagePreview} alt=\"Coin\" fill unoptimized className=\"object-cover\" />\n ) : (\n <ImagePlus className=\"h-6 w-6 text-muted-foreground\" />\n )}\n {imageUploading && (\n <span className=\"absolute inset-0 bg-background/70 flex items-center justify-center\">\n <Loader2 className=\"h-4 w-4 animate-spin text-primary\" />\n </span>\n )}\n </button>\n <div className=\"space-y-1 text-xs text-muted-foreground\">\n <p>JPG, PNG, GIF, SVG or WebP</p>\n {imagePreview && (\n <button type=\"button\" onClick={clearImage} className=\"inline-flex items-center gap-1 text-muted-foreground active:text-foreground\">\n <X className=\"h-3 w-3\" /> Remove\n </button>\n )}\n {uploadError && <p className=\"text-destructive\">{uploadError}</p>}\n {uploadSuccess && <p className=\"text-emerald-500\">✓ {uploadSuccess}</p>}\n </div>\n <input\n ref={fileInputRef}\n type=\"file\"\n accept={acceptFor(\"image\")}\n className=\"hidden\"\n onChange={(e) => { const f = e.target.files?.[0]; if (f) void handleImageSelect(f); }}\n />\n </div>\n </div>\n\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" value={name} onChange={(e) => handleNameChange(e.target.value)} placeholder=\"My Coin\" />\n {nameErr && <p className=\"text-xs text-destructive\">{nameErr}</p>}\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"symbol\">Symbol</Label>\n <Input id=\"symbol\" value={symbol} onChange={(e) => setSymbol(e.target.value.toUpperCase())} placeholder=\"COIN\" />\n {symErr && <p className=\"text-xs text-destructive\">{symErr}</p>}\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"description\">Description</Label>\n <Textarea\n id=\"description\"\n value={description}\n onChange={(e) => setDescription(e.target.value.slice(0, 500))}\n placeholder=\"Tell your community what this coin is about…\"\n rows={3}\n />\n </div>\n\n </section>\n\n <div className=\"h-px bg-border/60\" />\n\n <section className=\"space-y-4\">\n <div>\n <h3 className=\"text-lg font-bold\">Set the numbers</h3>\n </div>\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"supply\">Total supply</Label>\n <div className=\"flex gap-2 mb-1\">\n {SUPPLY_PRESETS.map((p) => (\n <button\n key={p.label}\n type=\"button\"\n onClick={() => setSupply(p.value)}\n className={cn(\n \"rounded-lg border px-3.5 py-1.5 text-sm font-medium\",\n supply === p.value ? \"border-brand-orange bg-brand-orange/10 text-brand-orange\" : \"border-border text-muted-foreground\",\n )}\n >\n {p.label}\n </button>\n ))}\n </div>\n <div className=\"relative\">\n <Input\n id=\"supply\" inputMode=\"numeric\"\n value={supply ? Number(supply).toLocaleString() : \"\"}\n onChange={(e) => setSupply(e.target.value.replace(/[^\\d]/g, \"\"))}\n placeholder=\"1,000,000\"\n className=\"pr-16 text-lg font-semibold tabular-nums\"\n />\n <span className=\"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm font-medium text-muted-foreground\">\n coins\n </span>\n </div>\n {supplyErr && <p className=\"text-xs text-destructive\">{supplyErr}</p>}\n </div>\n\n <div className=\"space-y-1.5\">\n <Label>Pair</Label>\n <div className=\"flex gap-2 flex-wrap\">\n {QUOTE_OPTIONS.map((q) => (\n <button\n key={q}\n type=\"button\"\n onClick={() => setQuote(q)}\n className={cn(\n \"inline-flex items-center gap-1.5 rounded-lg border px-3.5 py-1.5 text-sm font-medium\",\n quote === q ? \"border-brand-maeve bg-brand-maeve/10 text-brand-maeve\" : \"border-border text-muted-foreground\",\n )}\n >\n <CurrencyIcon symbol={q} size={16} />\n {q}\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"price\">Price ({quote} per coin)</Label>\n <div className=\"relative\">\n <span className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2\">\n <CurrencyIcon symbol={quote} size={16} />\n </span>\n <Input\n id=\"price\" inputMode=\"decimal\" value={price}\n onChange={(e) => setPrice(e.target.value.replace(/[^0-9.]/g, \"\"))}\n placeholder={String(SUGGESTED_DEFAULT_PRICE)}\n className=\"pl-9\"\n />\n </div>\n {priceErr && price && <p className=\"text-xs text-destructive\">{priceErr}</p>}\n </div>\n\n {preview && (\n <div className=\"rounded-xl bg-muted/50 dark:bg-muted/30 p-4\">\n <p className=\"text-2xs uppercase tracking-wide text-muted-foreground\">Starting market cap</p>\n <p className=\"text-2xl font-bold tabular-nums text-brand-maeve\">\n <CurrencyAmount amount={preview.fdv.toLocaleString()} symbol={quote} iconSize={18} />\n </p>\n </div>\n )}\n\n <div className=\"space-y-1.5\">\n <Label htmlFor=\"alloc\">Your allocation: {teamPct}%</Label>\n <input\n id=\"alloc\" type=\"range\" min={1} max={10} step={1}\n value={teamPct} onChange={(e) => setTeamPct(Number(e.target.value))}\n className=\"w-full accent-[hsl(var(--brand-orange))]\"\n />\n {preview && (\n <p className={cn(\"text-sm font-semibold\", insufficient ? \"text-destructive\" : \"text-foreground\")}>\n <CurrencyAmount amount={preview.buybackHuman} symbol={quote} iconSize={14} /> required\n </p>\n )}\n {insufficient && (\n <p className=\"text-xs text-destructive\">\n Your wallet doesn&apos;t have enough {quote}. Add funds, or adjust the numbers above.\n </p>\n )}\n </div>\n\n </section>\n\n <div className=\"h-px bg-border/60\" />\n\n <section className=\"space-y-4\">\n <GradientButton\n big\n onClick={handleLaunchClick}\n disabled={!canLaunch || tx.phase !== \"idle\"}\n className={!canLaunch || tx.phase !== \"idle\" ? \"opacity-40 pointer-events-none\" : \"\"}\n >\n {tx.phase !== \"idle\" ? <><Loader2 className=\"h-4 w-4 mr-1.5 animate-spin\" /> Launching…</> : <>Launch your coin <ArrowRight className=\"h-4 w-4 ml-1.5\" /></>}\n </GradientButton>\n <p className=\"text-xs text-muted-foreground text-center\">\n <Link href=\"/claim/memecoin\" className=\"underline active:text-foreground\">\n Already launched a coin? Claim it instead.\n </Link>\n </p>\n </section>\n </div>\n </ClaimRouteShell>\n </WalletRequired>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoMY;A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BAAG,KAAK;AAAA,sBAAI,MAAM;AAAA,sBAC/C,OAAO;AAAA,sBAAS,UAAU,CAAC,MAAM,WAAW,OAAO,EAAE,OAAO,KAAK,CAAC;AAAA,sBAClE,WAAU;AAAA;AAAA,kBACZ;AAAA,kBACC,WACC,6CAAC,OAAE,eAAW,cAAG,yBAAyB,eAAe,qBAAqB,iBAAiB,GAC7F;AAAA,gEAAC,uCAAe,QAAQ,QAAQ,cAAc,QAAQ,OAAO,UAAU,IAAI;AAAA,oBAAE;AAAA,qBAC/E;AAAA,kBAED,gBACC,6CAAC,OAAE,WAAU,4BAA2B;AAAA;AAAA,oBACA;AAAA,oBAAM;AAAA,qBAC9C;AAAA,mBAEJ;AAAA,iBAEJ;AAAA,cAEA,4CAAC,SAAI,WAAU,qBAAoB;AAAA,cAEnC,6CAAC,aAAQ,WAAU,aACf;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,KAAG;AAAA,oBACH,SAAS;AAAA,oBACT,UAAU,CAAC,aAAa,GAAG,UAAU;AAAA,oBACrC,WAAW,CAAC,aAAa,GAAG,UAAU,SAAS,mCAAmC;AAAA,oBAEjF,aAAG,UAAU,SAAS,4EAAE;AAAA,kEAAC,+BAAQ,WAAU,+BAA8B;AAAA,sBAAE;AAAA,uBAAW,IAAM,4EAAE;AAAA;AAAA,sBAAiB,4CAAC,kCAAW,WAAU,kBAAiB;AAAA,uBAAE;AAAA;AAAA,gBAC3J;AAAA,gBACA,4CAAC,OAAE,WAAU,6CACX,sDAAC,YAAAC,SAAA,EAAK,MAAK,mBAAkB,WAAU,oCAAmC,wDAE1E,GACF;AAAA,iBACJ;AAAA,eACF;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["validateName","validateSymbol","validateSupply","toRaw","Image","Link"]}
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface CoinCreateProps {
5
+ aside?: ReactNode;
6
+ tradeHref: (coinAddress: string) => string;
7
+ }
8
+ declare function CoinCreate({ aside, tradeHref }: CoinCreateProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CoinCreate, type CoinCreateProps };
@@ -0,0 +1,10 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface CoinCreateProps {
5
+ aside?: ReactNode;
6
+ tradeHref: (coinAddress: string) => string;
7
+ }
8
+ declare function CoinCreate({ aside, tradeHref }: CoinCreateProps): react_jsx_runtime.JSX.Element;
9
+
10
+ export { CoinCreate, type CoinCreateProps };