Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collection minter wip #35

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 1 addition & 38 deletions src/app/listings/[tab]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ListingsPage from "@/components/pages/listings";
import { API_HOST, AssetType } from "@/constants";
import type { BSV20TXO, OrdUtxo } from "@/types/ordinals";
import type { BSV20TXO } from "@/types/ordinals";
import { getCapitalizedAssetType } from "@/utils/assetType";
import * as http from "@/utils/httpClient";

Expand Down Expand Up @@ -29,43 +29,6 @@ const Listings = async ({ params }: { params: { tab: AssetType } }) => {
selectedAssetType={AssetType.BSV21}
/>
);
case AssetType.LRC20:
const q = {
insc: {
json: {
p: "lrc-20",
},
},
};

const urlLrc20 = `${API_HOST}/api/market?sort=recent&dir=desc&limit=20&offset=0&q=${btoa(
JSON.stringify(q)
)}`;
const { promise: promiseLrc20 } =
http.customFetch<OrdUtxo[]>(urlLrc20);
const lrc20Listings = await promiseLrc20;

const lrc20TokenIds = lrc20Listings
.filter((l) => !!l.origin?.data?.insc?.json?.id)
.map((l) => l.origin?.data?.insc?.json?.id!);

const urlLrc20Tokens = `${API_HOST}/api/txos/outpoints`;
const { promise: promiseLrc20Tokens } = http.customFetch<OrdUtxo[]>(
urlLrc20Tokens,
{
method: "POST",
body: JSON.stringify(lrc20TokenIds),
}
);
const lrc20Tokens = await promiseLrc20Tokens;

return (
<ListingsPage
lrc20Listings={lrc20Listings}
lrc20Tokens={lrc20Tokens}
selectedAssetType={AssetType.LRC20}
/>
);
default:
return null;
}
Expand Down
39 changes: 0 additions & 39 deletions src/app/market/[tab]/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import MarketPage from "@/components/pages/market";
import { API_HOST, AssetType } from "@/constants";
import { OrdUtxo } from "@/types/ordinals";
import { getCapitalizedAssetType } from "@/utils/assetType";
import * as http from "@/utils/httpClient";
import { redirect } from "next/navigation";

const Market = async ({
Expand All @@ -29,44 +28,6 @@ const Market = async ({
return (
<MarketPage selectedAssetType={AssetType.BSV21} id={tickOrId} />
);
case AssetType.LRC20: {
const q = {
insc: {
json: {
p: "lrc-20",
},
},
};

const urlLrc20 = `${API_HOST}/api/market?sort=recent&dir=desc&limit=20&offset=0&q=${btoa(
JSON.stringify(q)
)}`;
const { promise: promiseLrc20 } =
http.customFetch<OrdUtxo[]>(urlLrc20);
const lrc20Listings = await promiseLrc20;

const lrc20TokenIds = lrc20Listings
.filter((l) => !!l.origin?.data?.insc?.json?.id)
.map((l) => l.origin?.data?.insc?.json?.id!);

const urlLrc20Tokens = `${API_HOST}/api/txos/outpoints`;
const { promise: promiseLrc20Tokens } = http.customFetch<OrdUtxo[]>(
urlLrc20Tokens,
{
method: "POST",
body: JSON.stringify(lrc20TokenIds),
}
);
const lrc20Tokens = await promiseLrc20Tokens;

return (
<MarketPage
lrc20Listings={lrc20Listings}
lrc20Tokens={lrc20Tokens}
selectedAssetType={AssetType.LRC20}
/>
);
}
default:
return null;
}
Expand Down
59 changes: 0 additions & 59 deletions src/app/market/[tab]/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,6 @@ import type { AssetType } from "@/constants";
import { getCapitalizedAssetType } from "@/utils/assetType";

const Market = async ({ params }: { params: { tab: AssetType } }) => {
// switch (params.tab) {
// case AssetType.Ordinals:
// // TODO: Featured ordinals
// const urlImages = `${API_HOST}/api/market?sort=recent&dir=desc&limit=20&offset=0&type=image/png`;
// const { promise } = http.customFetch<OrdUtxo[]>(urlImages);
// const imageListings = await promise;
// return (
// <MarketPage
// imageListings={imageListings}
// selectedAssetType={AssetType.Ordinals}
// />
// );
// case AssetType.BSV20:
// return (
// <MarketPage
// selectedAssetType={AssetType.BSV20}
// />
// );
// case AssetType.BSV21:
// return (
// <MarketPage
// selectedAssetType={AssetType.BSV21}
// />
// );
// case AssetType.LRC20:
// const q = {
// insc: {
// json: {
// p: "lrc-20",
// },
// },
// };

// const urlLrc20 = `${API_HOST}/api/market?sort=recent&dir=desc&limit=20&offset=0&q=${btoa(
// JSON.stringify(q)
// )}`;
// const { promise: promiseLrc20 } = http.customFetch<OrdUtxo[]>(urlLrc20);
// const lrc20Listings = await promiseLrc20;

// const lrc20TokenIds = lrc20Listings
// .filter((l) => !!l.origin?.data?.insc?.json?.id)
// .map((l) => l.origin?.data?.insc?.json?.id!);

// const urlLrc20Tokens = `${API_HOST}/api/txos/outpoints`;
// const { promise: promiseLrc20Tokens } = http.customFetch<OrdUtxo[]>(
// urlLrc20Tokens,
// {
// method: "POST",
// body: JSON.stringify(lrc20TokenIds),
// }
// );
// const lrc20Tokens = await promiseLrc20Tokens;

// return (

// );
// default:
// return null;
// }
return <NewListingPage type={params.tab} />;
};
export default Market;
Expand Down
41 changes: 1 addition & 40 deletions src/app/market/[tab]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import MarketPage from "@/components/pages/market";
import { API_HOST, AssetType } from "@/constants";
import type { OrdUtxo } from "@/types/ordinals";
import { AssetType } from "@/constants";
import { getCapitalizedAssetType } from "@/utils/assetType";
import * as http from "@/utils/httpClient";

const Market = async ({ params }: { params: { tab: AssetType } }) => {
switch (params.tab) {
Expand All @@ -21,43 +19,6 @@ const Market = async ({ params }: { params: { tab: AssetType } }) => {
return <MarketPage selectedAssetType={AssetType.BSV20} />;
case AssetType.BSV21:
return <MarketPage selectedAssetType={AssetType.BSV21} />;
case AssetType.LRC20:
const q = {
insc: {
json: {
p: "lrc-20",
},
},
};

const urlLrc20 = `${API_HOST}/api/market?sort=recent&dir=desc&limit=20&offset=0&q=${btoa(
JSON.stringify(q)
)}`;
const { promise: promiseLrc20 } =
http.customFetch<OrdUtxo[]>(urlLrc20);
const lrc20Listings = await promiseLrc20;

const lrc20TokenIds = lrc20Listings
.filter((l) => !!l.origin?.data?.insc?.json?.id)
.map((l) => l.origin?.data?.insc?.json?.id!);

const urlLrc20Tokens = `${API_HOST}/api/txos/outpoints`;
const { promise: promiseLrc20Tokens } = http.customFetch<OrdUtxo[]>(
urlLrc20Tokens,
{
method: "POST",
body: JSON.stringify(lrc20TokenIds),
}
);
const lrc20Tokens = await promiseLrc20Tokens;

return (
<MarketPage
lrc20Listings={lrc20Listings}
lrc20Tokens={lrc20Tokens}
selectedAssetType={AssetType.LRC20}
/>
);
default:
return null;
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/Collections/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
import { Noto_Serif } from "next/font/google";
import Image from "next/image";
import Link from "next/link";
import { FaPlus } from "react-icons/fa6";
import "slick-carousel/slick/slick-theme.css";
import "slick-carousel/slick/slick.css";
import FeaturedCollections from "./featured";
Expand All @@ -29,7 +30,12 @@ const Collections = () => {
<>
<h1 className={`px-2 text-2xl mb-4 ${notoSerif.className}`}>Featured Collections</h1>
<FeaturedCollections />
<h1 className={`text-2xl px-2 mb-4 ${notoSerif.className}`}>Current Hype</h1>
<h1 className={"text-2xl px-2 mb-4 flex justify-between"}>
<div className={notoSerif.className}>
Current Hype
</div>
<Link className="btn btn-sm" href="/inscribe?tab=collection"><FaPlus className="mr-1" />New</Link>
</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2 w-full">
{data?.map((c) => (
<div key={c.outpoint} className="relative overflow-hidden mx-auto w-[300px] h-[300px]">
Expand Down
37 changes: 0 additions & 37 deletions src/components/LRC20Listings/index.tsx

This file was deleted.

56 changes: 0 additions & 56 deletions src/components/LRC20Listings/list.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions src/components/OrdinalListings/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ const List = ({ term, address, onClick }: Props) => {
true
).toString()} BSV`;
return (
// biome-ignore lint/correctness/useJsxKeyInIterable: <explanation>
listing && (
<tr
key={`k-${listing?.txid}-${listing?.vout}-${listing?.height}`}
Expand Down Expand Up @@ -239,7 +238,7 @@ const List = ({ term, address, onClick }: Props) => {
)
);
})}
{listings.value.length === 0 && (
{!isFetching && listings.value.length === 0 && (
<tr>
<td className="text-center" colSpan={5}>
No listings found
Expand Down
14 changes: 0 additions & 14 deletions src/components/artifact/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ const Model = dynamic(() => import("../model"), {

export enum ArtifactType {
All = "All",
// Image = 1,
// Model = 2,
// PDF = 3,
// Video = 4,
// Javascript = 5,
// HTML = 6,
// MarkDown = 7,
// Text = 8,
// JSON = 9,
// BSV20 = 10,
// OPNS = 11,
// Unknown = 12,
// LRC20 = 13,
// Audio = 14,
Image = "Image",
Model = "Model",
PDF = "PDF",
Expand Down
Loading