Skip to content

Commit f30af52

Browse files
committed
working
1 parent ceca0a5 commit f30af52

17 files changed

Lines changed: 211 additions & 108504 deletions

File tree

.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ API_DATABASE_AUTH_TOKEN= # for Turso
2020
# Get your API key from https://cloud.near.ai
2121
NEAR_AI_API_KEY=
2222
NEAR_AI_BASE_URL=https://cloud-api.near.ai/v1
23-
NEAR_AI_MODEL=deepseek-ai/DeepSeek-V3.1
23+
NEAR_AI_MODEL=deepseek-ai/DeepSeek-V3.1
24+
25+
# NEARBlocks API
26+
# Get your API key from https://nearblocks.io/apis
27+
NEAR_BLOCK=

api/src/builders.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const handleBuildersRequest = (
7373
method: "GET",
7474
headers: {
7575
"Content-Type": "application/json",
76-
Authorization: `Bearer 10D94E2ECC9F460CB105030A47006C3D`,
76+
Authorization: `Bearer ${process.env.NEAR_BLOCK || ""}`,
7777
},
7878
}),
7979
);

api/src/services/near.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export class NearService {
9797
try {
9898
const tokens = await this.fetchNftsFromChain(nearAccountId, this.config.initiateContractId);
9999
return tokens.length > 0;
100-
} catch (error) {
101-
console.error(`[NearService] Error checking initiate token for ${nearAccountId}:`, error);
100+
} catch {
101+
// Silently return false for errors - missing initiate token is expected for many users
102102
return false;
103103
}
104104
}

ui/src/components/builders/BuilderList.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ interface BuilderListProps {
2121
onLoadMoreError?: string | null;
2222
onClearLoadMoreError?: () => void;
2323
onSearchNavigate?: (accountId: string) => void;
24+
sentinelRef?: React.RefObject<HTMLDivElement | null>;
2425
}
2526

2627
function BuilderListItemSkeleton({ index }: { index: number }) {
@@ -72,6 +73,7 @@ export function BuilderList({
7273
onLoadMoreError,
7374
onClearLoadMoreError,
7475
onSearchNavigate,
76+
sentinelRef,
7577
}: BuilderListProps) {
7678
const [searchQuery, setSearchQuery] = useState("");
7779
const totalCount = (totalCounts?.legion || 0) + (totalCounts?.initiate || 0);
@@ -202,24 +204,26 @@ export function BuilderList({
202204
</button>
203205
</div>
204206
) : (
205-
<button
206-
type="button"
207-
onClick={onLoadMore}
208-
disabled={isLoadingMore}
209-
className="w-full py-2.5 text-sm text-primary hover:bg-primary/10 font-mono font-medium border border-primary/30 transition-colors disabled:opacity-50"
210-
>
207+
<div className="text-center">
211208
{isLoadingMore ? (
212-
<span className="flex items-center justify-center gap-2">
209+
<div className="flex items-center justify-center gap-2 py-2">
213210
<span className="size-4 border-2 border-primary/30 border-t-primary rounded-full animate-spin" />
214-
Loading...
215-
</span>
211+
<span className="text-sm text-muted-foreground font-mono">Loading...</span>
212+
</div>
216213
) : (
217-
"Load more"
214+
<span className="text-xs text-muted-foreground font-mono">
215+
{builders.length} loaded • Scroll for more
216+
</span>
218217
)}
219-
</button>
218+
</div>
220219
)}
221220
</div>
222221
)}
222+
223+
{/* Sentinel element for infinite scroll intersection observer */}
224+
{hasMore && !searchQuery && (
225+
<div ref={sentinelRef} className="h-1" aria-hidden="true" />
226+
)}
223227
</>
224228
)}
225229
</div>

0 commit comments

Comments
 (0)