Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@
"@ar.io/wayfinder-core": "^1.0.4",
"@ar.io/wayfinder-react": "^1.0.11",
"@ardrive/turbo-sdk": "^1.23.1",
"@blockydevs/arns-marketplace-data": "^0.1.0",
"@blockydevs/arns-marketplace-ui": "^0.1.0",
"@permaweb/aoconnect": "0.0.69",
"@radix-ui/react-checkbox": "^1.1.4",
"@radix-ui/react-popover": "^1.1.15",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-select": "^2.1.4",
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.13",
"@sentry/react": "^7.45.0",
"@stripe/react-stripe-js": "^3.6.0",
"@stripe/stripe-js": "^7.0.0",
Expand All @@ -48,6 +52,7 @@
"arweave-graphql": "^0.0.5",
"arweave-wallet-connector": "^1.0.2",
"axios": "^1.1.3",
"class-variance-authority": "^0.7.1",
"dayjs": "^1.11.13",
"emoji-regex": "^10.3.0",
"eventemitter3": "^5.0.0",
Expand All @@ -60,6 +65,7 @@
"puny-coder": "^1.0.1",
"radix-ui": "^1.1.3",
"react": "^18.2.0",
"react-day-picker": "^9.9.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-markdown": "6",
Expand Down
74 changes: 73 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,26 @@ import NetworkSettings from './components/pages/Settings/NetworkSettings';
import DevTools from './components/pages/Settings/devtools/DevTools';
import useSyncSettings from './hooks/useSyncSettings/useSyncSettings';
import useWanderEvents from './hooks/useWanderEvents/useWanderEvents';
import './index.css';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be why some styling is off

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import '@src/index.css'; it's moved to main.tsx and should override the package styles

are you able to provide examples with screenshots of things that don’t look the way they should?

import { useGlobalState } from './state';

// set the log level of ar-io-sdk
Logger.default.setLogLevel('none');

const MyANTs = React.lazy(() => import('./components/pages/MyANTs/MyANTs'));
const MyANTsNewListing = React.lazy(
() => import('./components/pages/MyANTs/NewListing'),
);
const Manage = React.lazy(() => import('./components/pages/Manage/Manage'));
const Home = React.lazy(() => import('./components/pages/Home/Home'));

const Listings = React.lazy(
() => import('./components/pages/Listings/Listings'),
);
const Details = React.lazy(
() => import('./components/pages/Listings/Details/Details'),
);
const Confirm = React.lazy(() => import('./components/pages/Listings/Confirm'));

const ManageANT = React.lazy(
() => import('./components/pages/ManageANT/ManageANT'),
);
Expand Down Expand Up @@ -336,6 +348,66 @@ function App() {
</Suspense>
}
/>
<Route
path="/listings"
element={
<Suspense
fallback={
<PageLoader loading={true} message={'Loading, please wait'} />
}
>
<Listings />
</Suspense>
}
/>
<Route
path="/listings/:id"
element={
<Suspense
fallback={
<PageLoader loading={true} message={'Loading, please wait'} />
}
>
<Details />
</Suspense>
}
/>
<Route
path="/listings/:id/confirm-purchase"
element={
<Suspense
fallback={
<PageLoader loading={true} message={'Loading, please wait'} />
}
>
<Confirm />
</Suspense>
}
/>
<Route
path="/my-ants"
element={
<Suspense
fallback={
<PageLoader loading={true} message={'Loading, please wait'} />
}
>
<MyANTs />
</Suspense>
}
/>
<Route
path="/my-ants/new-listing/:antProcessId"
element={
<Suspense
fallback={
<PageLoader loading={true} message={'Loading, please wait'} />
}
>
<MyANTsNewListing />
</Suspense>
}
/>
<Route
path="*"
element={
Expand Down
2 changes: 1 addition & 1 deletion src/components/cards/NavMenuCard/NavMenuCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function NavMenuCard() {
>
What are ARIO tokens?
</Link>
</span>{' '}
</span>
<span className="flex flex-row" style={{ gap: '10px' }}>
<Settings2Icon
className="text-grey"
Expand Down
23 changes: 21 additions & 2 deletions src/components/data-display/tables/DomainsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { ANTStateError } from '@src/utils/errors';
import { queryClient } from '@src/utils/network';
import { ColumnDef, createColumnHelper } from '@tanstack/react-table';
import { capitalize } from 'lodash';
import { CircleCheck, Star } from 'lucide-react';
import { BookCopy, CircleCheck, Star } from 'lucide-react';
import { useEffect, useState } from 'react';
import { ReactNode } from 'react-markdown';
import { Link, useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -470,7 +470,7 @@ const DomainsTable = ({
case 'action': {
return (
<div className="flex justify-end w-full">
<span className="flex pr-3 w-fit gap-3">
<span className="flex pr-3 w-fit gap-3">
{row.getValue('role') === 'owner' ? (
<Tooltip
message={
Expand Down Expand Up @@ -530,6 +530,25 @@ const DomainsTable = ({
) : (
<></>
)}
{row.getValue('role') === 'owner' && (
<Tooltip
message="Sell"
icon={
<button
disabled={row.original.version < MIN_ANT_VERSION}
onClick={() =>
navigate(
`/my-ants/new-listing/${row.original.processId.toString()}?name=${
row.original.name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a util for parsing url safe domains, good to use here.

Suggested change
row.original.name
lowerCaseDomain(row.original.name)

}`,
)
}
>
<BookCopy className="w-[18px] text-grey" />
</button>
}
/>
)}
Comment on lines 533 to 551
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Consider URL-encoding the name parameter in the query string.

The navigation constructs a URL with the domain name as a query parameter, but the name is not URL-encoded. If domain names contain special characters (spaces, ampersands, Unicode, etc.), this could result in malformed URLs.

Apply this diff to properly encode the name parameter:

                    <Tooltip
                      message="Sell"
                      icon={
                        <button
                          disabled={row.original.version < MIN_ANT_VERSION}
                          onClick={() =>
                            navigate(
-                             `/my-ants/new-listing/${row.original.processId.toString()}?name=${
-                               row.original.name
-                             }`,
+                             `/my-ants/new-listing/${row.original.processId}?name=${encodeURIComponent(
+                               row.original.name
+                             )}`,
                            )
                          }
                        >
                          <BookCopy className="w-[18px] text-grey" />
                        </button>
                      }
                    />

Note: The .toString() call on processId is also redundant since it's already a string, and has been removed in the suggestion above.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{row.getValue('role') === 'owner' && (
<Tooltip
message="Sell"
icon={
<button
disabled={row.original.version < MIN_ANT_VERSION}
onClick={() =>
navigate(
`/my-ants/new-listing/${row.original.processId.toString()}?name=${
row.original.name
}`,
)
}
>
<BookCopy className="w-[18px] text-grey" />
</button>
}
/>
)}
{row.getValue('role') === 'owner' && (
<Tooltip
message="Sell"
icon={
<button
disabled={row.original.version < MIN_ANT_VERSION}
onClick={() =>
navigate(
`/my-ants/new-listing/${row.original.processId}?name=${encodeURIComponent(
row.original.name
)}`,
)
}
>
<BookCopy className="w-[18px] text-grey" />
</button>
}
/>
)}
🤖 Prompt for AI Agents
In src/components/data-display/tables/DomainsTable.tsx around lines 533 to 551,
the navigation URL builds a query string with row.original.name without
URL-encoding which can break for spaces/special chars; update the navigate call
to URL-encode the name (e.g., use encodeURIComponent(row.original.name)) and
remove the redundant .toString() on processId if it is already a string so the
resulting URL is well-formed and safe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of encoding URI component, we have a lowerCaseDomain utility for the names

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find and examine the lowerCaseDomain utility implementation
ast-grep --pattern 'function lowerCaseDomain($$$) {
  $$$
}'

# Also search for export statements
ast-grep --pattern 'export $_ lowerCaseDomain = $$$'

# Fallback with rg to locate the function
rg -nP 'lowerCaseDomain\s*[=:]' --type=ts --type=tsx -A 10

Length of output: 281


🏁 Script executed:

#!/bin/bash
# Search for usage patterns of lowerCaseDomain in navigation/URL construction
rg -nP 'lowerCaseDomain.*navigate|navigate.*lowerCaseDomain' --type=ts -B 2 -A 2

# Also check for lowerCaseDomain usage in Link components or URL building
rg -nP 'lowerCaseDomain.*to=|to=.*lowerCaseDomain' --type=ts -B 2 -A 2

# Look for any query string construction with lowerCaseDomain
rg -nP 'lowerCaseDomain.*\?.*=' --type=ts -B 2 -A 2

Length of output: 1848


🏁 Script executed:

#!/bin/bash
# Search for query string construction with name or domain parameters
rg -nP '\?name=' --type=ts -B 1 -A 1

# Also search for URLSearchParams or query parameter encoding
rg -nP 'encodeURIComponent.*name|URLSearchParams' --type=ts -B 2 -A 2

Length of output: 4825


@atticusofsparta, you're absolutely right—using lowerCaseDomain maintains consistency with how domain names are handled throughout the codebase. I can see it's used for path normalization in navigation elsewhere.

For the minimal fix respecting your approach, you could apply:

navigate(
  `/my-ants/new-listing/${row.original.processId}?name=${lowerCaseDomain(
    row.original.name
  )}`,
)

However, I noticed that newer components in this PR (like FixedListingPriceSection.tsx and DutchListingPriceSection.tsx) use URLSearchParams for building query strings, which automatically handles URL encoding:

const params = new URLSearchParams({
  name: lowerCaseDomain(row.original.name),
  // ... other params
});
navigate(`/my-ants/new-listing/${row.original.processId}?${params.toString()}`);

This pattern would be more robust for edge cases while still using lowerCaseDomain for normalization. Either way works, but the URLSearchParams approach aligns with the pattern established in the Listings feature components.

<ManageAssetButtons
id={lowerCaseDomain(row.getValue('name') as string)}
assetType="names"
Expand Down
1 change: 0 additions & 1 deletion src/components/layout/Navbar/NavGroup/NavGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function NavGroup() {
<div className="flex-right flex size-fit gap-4 items-center">
{!isMobile ? (
<>
{' '}
<NotificationMenu />
{links}
{!wallet || !walletAddress ? <ConnectButton /> : <NavMenuCard />}
Expand Down
90 changes: 90 additions & 0 deletions src/components/pages/Listings/ActiveListingsTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { fetchActiveListings } from '@blockydevs/arns-marketplace-data';
import {
ActiveListingTable,
Card,
type Domain,
Pagination,
useCursorPagination,
} from '@blockydevs/arns-marketplace-ui';
import { useGlobalState } from '@src/state';
import {
BLOCKYDEVS_ACTIVITY_PROCESS_ID,
getCurrentListingArioPrice,
marketplaceQueryKeys,
} from '@src/utils/marketplace';
import { useQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';

const PAGE_SIZE = 20;

const ActiveListingsTab = () => {
const navigate = useNavigate();
const [{ aoClient }] = useGlobalState();
const pagination = useCursorPagination(PAGE_SIZE);

const queryActiveListings = useQuery({
refetchInterval: 15 * 1000,
Copy link
Contributor

@atticusofsparta atticusofsparta Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another question of if we need this refetch interval - its a costly query. Especially since this is a paginated query.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to show users newly added listings in real time, then this interval is necessary. If it’s not that important for us, we can skip it here.

structuralSharing: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are using isPending below - i don't know much about this param I'll admit but i think we do want this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queryKey: marketplaceQueryKeys.listings.list('active', {
page: pagination.page,
pageSize: pagination.pageSize,
Comment on lines +27 to +29
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably have cursor in here as well, since the page number and size may be the same with a different cursor.

}),
queryFn: () => {
return fetchActiveListings({
Comment on lines 24 to 33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Guard the query until aoClient is ready.

Without enabled, the query may run with aoClient undefined and fail.

   const queryActiveListings = useQuery({
     refetchInterval: 15 * 1000,
     structuralSharing: false,
+    enabled: Boolean(aoClient),
     queryKey: marketplaceQueryKeys.listings.list('active', {
       page: pagination.page,
       pageSize: pagination.pageSize,
     }),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const queryActiveListings = useQuery({
refetchInterval: 15 * 1000,
structuralSharing: false,
queryKey: marketplaceQueryKeys.listings.list('active', {
page: pagination.page,
pageSize: pagination.pageSize,
}),
queryFn: () => {
return fetchActiveListings({
const queryActiveListings = useQuery({
refetchInterval: 15 * 1000,
structuralSharing: false,
enabled: Boolean(aoClient),
queryKey: marketplaceQueryKeys.listings.list('active', {
page: pagination.page,
pageSize: pagination.pageSize,
}),
queryFn: () => {
return fetchActiveListings({
🤖 Prompt for AI Agents
In src/components/pages/Listings/ActiveListingsTab.tsx around lines 25 to 33,
the useQuery may run before aoClient is initialized causing failures; add an
enabled flag that checks aoClient readiness (e.g., enabled: !!aoClient) to the
useQuery options so the query will not execute until aoClient is defined, and
ensure the queryFn only references aoClient when enabled.

ao: aoClient,
activityProcessId: BLOCKYDEVS_ACTIVITY_PROCESS_ID,
limit: pagination.pageSize,
cursor: pagination.cursor,
});
},
select: (data) => {
pagination.storeNextCursor(data.nextCursor, !!data.hasMore);

return {
...data,
items: data.items.map((item): Domain => {
const currentPrice = getCurrentListingArioPrice(item);

return {
name: item.name,
endDate: item.expiresAt ?? undefined,
ownershipType: item.ownershipType,
price: {
type: item.type === 'english' ? 'bid' : 'buyout',
symbol: 'ARIO',
value: Number(currentPrice),
},
type: {
value: item.type,
},
action: () => {
navigate(`/listings/${item.orderId}`);
},
};
}),
};
},
});

const { totalItems } = queryActiveListings.data ?? {};
const totalPages = pagination.getTotalPages(totalItems);

return (
<Card className="flex flex-col gap-8">
<ActiveListingTable
data={queryActiveListings.data?.items ?? []}
isPending={queryActiveListings.isPending}
error={queryActiveListings.error?.message}
/>
{!queryActiveListings.isPending && (
<Pagination
totalPages={totalPages}
activeIndex={pagination.page}
onPageChange={pagination.setPage}
/>
)}
</Card>
);
};

export default ActiveListingsTab;
91 changes: 91 additions & 0 deletions src/components/pages/Listings/CompletedListingsTab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { fetchCompletedListings } from '@blockydevs/arns-marketplace-data';
import {
Card,
CompletedListingTable,
type Domain,
Pagination,
useCursorPagination,
} from '@blockydevs/arns-marketplace-ui';
import { useGlobalState } from '@src/state';
import {
BLOCKYDEVS_ACTIVITY_PROCESS_ID,
getCurrentListingArioPrice,
marketplaceQueryKeys,
} from '@src/utils/marketplace';
import { useQuery } from '@tanstack/react-query';
import { useNavigate } from 'react-router-dom';

const PAGE_SIZE = 20;

const CompletedListingsTab = () => {
const navigate = useNavigate();
const [{ aoClient }] = useGlobalState();
const pagination = useCursorPagination(PAGE_SIZE);

const queryCompletedListings = useQuery({
refetchInterval: 15 * 1000,
enabled: Boolean(aoClient),
queryKey: marketplaceQueryKeys.listings.list('completed', {
page: pagination.page,
pageSize: pagination.pageSize,
}),
queryFn: () => {
return fetchCompletedListings({
ao: aoClient,
activityProcessId: BLOCKYDEVS_ACTIVITY_PROCESS_ID,
limit: pagination.pageSize,
cursor: pagination.cursor,
});
},
Comment on lines 24 to 39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refetch question on this one

  • query key should probably have cursor

select: (data) => {
pagination.storeNextCursor(data.nextCursor, !!data.hasMore);

return {
...data,
items: data.items.map((item): Domain => {
const currentPrice = getCurrentListingArioPrice(item);

return {
name: item.name,
createdAt: item.createdAt,
endDate: item.endedAt,
ownershipType: item.ownershipType,
price: {
type: item.type === 'english' ? 'bid' : 'buyout',
symbol: 'ARIO',
value: Number(currentPrice),
},
type: {
value: item.type,
},
action: () => {
navigate(`/listings/${item.orderId}`);
},
};
}),
};
},
});

const { totalItems } = queryCompletedListings.data ?? {};
const totalPages = pagination.getTotalPages(totalItems);

return (
<Card className="flex flex-col gap-8">
<CompletedListingTable
data={queryCompletedListings.data?.items ?? []}
isPending={queryCompletedListings.isPending}
error={queryCompletedListings.error?.message}
/>
{!queryCompletedListings.isPending && (
<Pagination
totalPages={totalPages}
activeIndex={pagination.page}
onPageChange={pagination.setPage}
/>
)}
</Card>
);
};

export default CompletedListingsTab;
Loading
Loading