Skip to content
Merged
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
4 changes: 3 additions & 1 deletion env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ AKAVE_API_KEY=
LIGHTHOUSE_API_KEY=

STORACHA_KEY=
STORACHA_PROOF=
STORACHA_PROOF=

PASSPORT_API_KEY=
5 changes: 5 additions & 0 deletions packages/domain/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export default {
key: process.env.STORACHA_KEY,
proof: process.env.STORACHA_PROOF,
},
passport: {
endpointUrl:
process.env.PASSPORT_API_ENDPOINT_URL || "https://api.passport.xyz",
apiKey: process.env.PASSPORT_API_KEY,
},
alchemy: {
apiKey: process.env.ALCHEMY_API_KEY,
},
Expand Down
4 changes: 2 additions & 2 deletions packages/ui-react/src/components/passport/score-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const PassportScoreCard = ({
passportParams,
className,
}: PassportScoreCardProps) => {
const { data, isPending, error } = useQuery({
const { data, isSuccess, error } = useQuery({
queryKey: ["passport-score", address, passportParams],
queryFn: async () => {
if ("model" in passportParams) {
Expand Down Expand Up @@ -124,7 +124,7 @@ export const PassportScoreCard = ({
</CardHeader>
<CardContent>
<div className="space-y-4">
{isPending ? (
{!isSuccess ? (
<>
<Skeleton className="h-4 w-48" />
<Skeleton className="h-4 w-48" />
Expand Down
9 changes: 3 additions & 6 deletions packages/ui-react/src/lib/passport/api.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import config from "@geist/domain/config";
import ky from "ky";
import type { Address } from "viem";

const PASSPORT_API_ENDPOINT = "https://api.passport.xyz";

const PASSPORT_API_KEY = process.env.PASSPORT_API_KEY || "";

/**
* Creates a URL for the Passport API endpoint
*/
export const createEndpointUrl = (
path: string,
queryParams?: Record<string, string>,
) => {
const url = `${PASSPORT_API_ENDPOINT}${path}`;
const url = `${config.passport.endpointUrl}${path}`;
if (!queryParams) return url;

const params = new URLSearchParams();
Expand All @@ -33,7 +30,7 @@ export const createFetchOptions = (
options: {
headers: {
accept: "application/json",
"X-API-Key": PASSPORT_API_KEY,
"X-API-Key": config.passport.apiKey,
},
},
};
Expand Down
Loading