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
25 changes: 0 additions & 25 deletions src/app/actions/sonar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import { createSonarServerAction } from "@/lib/sonar";
import {
ListAvailableEntitiesResponse,
ReadEntityResponse,
PrePurchaseCheckResponse,
GeneratePurchasePermitResponse,
APIError,
} from "@echoxyz/sonar-core";

type ListAvailableEntitiesInput = { saleUUID: string };
Expand All @@ -23,29 +21,6 @@ export const getEntities = createSonarServerAction<ListAvailableEntitiesInput, L
}
);

type ReadEntityInput = { saleUUID: string; walletAddress: string };

/**
* Fetch a specific entity by wallet address
*/
export const getEntity = createSonarServerAction<ReadEntityInput, ReadEntityResponse>(
async (client, { saleUUID, walletAddress }) => {
if (!saleUUID || !walletAddress) {
throw new Error("Missing saleUUID or walletAddress");
}

try {
return await client.readEntity({ saleUUID, walletAddress });
} catch (error) {
// Special handling: 404 returns null entity instead of error
if (error instanceof APIError && error.status === 404) {
return { Entity: null } as unknown as ReadEntityResponse;
}
throw error;
}
}
);

type PrePurchaseCheckInput = { saleUUID: string; entityID: string; walletAddress: string };

/**
Expand Down
33 changes: 0 additions & 33 deletions src/app/hooks/use-sonar-entity.ts

This file was deleted.