Skip to content
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
12 changes: 12 additions & 0 deletions apps/scan/src/app/_components/resources/executor/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { Method } from './method';

import { Tags } from '@/app/_components/tags';
import { formatTokenAmount } from '@/lib/token';

import type { Resources, Tag } from '@x402scan/scan-db/types';
import type { Methods } from '@/types/x402';
Expand All @@ -23,6 +24,12 @@ export const Header: React.FC<Props> = ({
response,
hideOrigin = false,
}) => {
// Extract the amount from the first accept option
const accept = response.accepts?.[0];
const maxAmountRequired = accept?.maxAmountRequired
? BigInt(accept.maxAmountRequired)
: null;

return (
<div className="flex-1 flex flex-col gap-2 w-0">
<div className="flex md:items-center justify-between flex-col md:flex-row gap-4 md:gap-0 flex-1">
Expand All @@ -34,6 +41,11 @@ export const Header: React.FC<Props> = ({
: resource.resource}
</span>
<Tags tags={tags} />
{maxAmountRequired !== null && (
<span className="inline-flex items-center gap-1 rounded-md bg-primary/10 px-2 py-1 text-xs font-medium text-primary">
{formatTokenAmount(maxAmountRequired)} USDC
</span>
)}
</div>
</div>
<p className="text-xs text-muted-foreground">
Expand Down
1 change: 1 addition & 0 deletions apps/scan/src/app/_components/resources/executor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const LoadingResourceExecutor = () => {
<div className="flex items-center gap-2 flex-1 w-full md:w-auto">
<Skeleton className="w-8 h-4" />
<Skeleton className="w-36 h-[16px] md:h-[18px]" />
<Skeleton className="w-16 h-6 rounded-md" />
</div>
</div>
<Skeleton className="w-full h-[12px] md:h-[14px]" />
Expand Down
4 changes: 0 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.