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
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const ContractInfo = ({
isLoading,
isSacType,
}: {
infoData: ContractInfoApiResponse | undefined;
infoData: ContractInfoApiResponse | null | undefined;
contractId: string;
backendStatus: "healthy" | "unhealthy";
wasmData: WasmData | null | undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/query/external/useSEContractInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const useSEContractInfo = ({
networkId: NetworkType;
contractId: string;
}) => {
const query = useQuery<ContractInfoApiResponse>({
const query = useQuery({
queryKey: ["useSEContractInfo", networkId, contractId],
queryFn: async () => {
queryFn: async (): Promise<ContractInfoApiResponse | null> => {
const network = getStellarExpertNetwork(networkId);

if (!network) {
Expand Down
4 changes: 2 additions & 2 deletions src/query/external/useSEContractStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export const useSEContractStorage = ({
contractId: string;
totalEntriesCount: number | undefined;
}) => {
const query = useQuery<ContractStorageResponseItem[] | null>({
const query = useQuery({
queryKey: ["useSEContractStorage", networkId, contractId],
queryFn: async () => {
queryFn: async (): Promise<ContractStorageResponseItem[] | null> => {
// No entries
if (!totalEntriesCount) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/query/external/useSEContractVersionHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const useSEContractVersionHistory = ({
networkId: NetworkType;
contractId: string;
}) => {
const query = useQuery<ContractVersionHistoryResponseItem[]>({
const query = useQuery({
queryKey: ["useSEContractVersionHistory", networkId, contractId],
queryFn: async () => {
queryFn: async (): Promise<ContractVersionHistoryResponseItem[] | null> => {
const network = getStellarExpertNetwork(networkId);

if (!network) {
Expand Down
4 changes: 2 additions & 2 deletions src/query/external/useSEContractWasmBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export const useSEContractWasmBinary = ({
networkId: NetworkType;
wasmHash: string;
}) => {
const query = useQuery<ArrayBuffer | null>({
const query = useQuery({
queryKey: ["useSEContractWasmBinary", networkId, wasmHash],
queryFn: async () => {
queryFn: async (): Promise<ArrayBuffer | null> => {
const network = getStellarExpertNetwork(networkId);

if (!network) {
Expand Down
12 changes: 6 additions & 6 deletions src/query/external/useSEContractsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export const useSEContractsList = ({
cursor?: string;
order?: "asc" | "desc";
}) => {
const query = useQuery<{
records: ContractListRecord[];
prevCursor: string | null;
nextCursor: string | null;
} | null>({
const query = useQuery({
queryKey: ["useSEContractsList", networkId, cursor, order],
queryFn: async () => {
queryFn: async (): Promise<{
records: ContractListRecord[];
prevCursor: string | null;
nextCursor: string | null;
}> => {
const network = getStellarExpertNetwork(networkId);

if (!network) {
Expand Down
4 changes: 2 additions & 2 deletions src/query/useContractClientFromRpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const useContractClientFromRpc = ({
networkPassphrase: string;
rpcUrl: string;
}) => {
const query = useQuery<contract.Client | null>({
const query = useQuery({
queryKey: ["useClientFromRpc", contractId, networkPassphrase, rpcUrl],
queryFn: async () => {
queryFn: async (): Promise<contract.Client> => {
try {
const client = await contract.Client.from({
contractId,
Expand Down
20 changes: 11 additions & 9 deletions src/query/useGetContractDataFromRpcById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ export const useGetContractDataFromRpcById = ({
const execStellarAssetType =
xdr.ContractExecutableType.contractExecutableStellarAsset().name;

const query = useQuery<
| {
contractType: typeof execWasmType | typeof execStellarAssetType | null;
wasmHash: string;
}
| null
| undefined
>({
const query = useQuery({
queryKey: ["useGetContractDataFromRpcById", contractId, rpcUrl],
queryFn: async () => {
queryFn: async (): Promise<
| {
contractType:
| typeof execWasmType
| typeof execStellarAssetType
| null;
wasmHash: string;
}
| null
> => {
Comment thread
Copilot marked this conversation as resolved.
if (!contractId || !rpcUrl) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/query/useGitHubFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const useGitHubFile = ({
file: string;
isActive: boolean;
}) => {
const query = useQuery<string | null>({
const query = useQuery({
queryKey: ["useGitHubFile", repo, path, file],
queryFn: async () => {
queryFn: async (): Promise<string | null> => {
if (!repo || !path || !file) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/query/useGitHubReadmeText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export const useGitHubReadmeText = ({
commit: string;
isActive: boolean;
}) => {
const query = useQuery<string | null>({
const query = useQuery({
queryKey: ["useGitHubReadmeText", repo, commit],
queryFn: async () => {
queryFn: async (): Promise<string | null> => {
if (!repo || !commit) {
return null;
}
Expand Down
8 changes: 6 additions & 2 deletions src/query/useMaintenanceData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ import { useQuery } from "@tanstack/react-query";
import { StatusPageScheduled } from "@/types/types";

export const useMaintenanceData = () => {
const query = useQuery<StatusPageScheduled[]>({
const query = useQuery({
queryKey: ["maintenanceData"],
queryFn: async () => {
queryFn: async (): Promise<StatusPageScheduled[]> => {
try {
const scheduleResponse = await fetch(
Comment thread
jeesunikim marked this conversation as resolved.
"https://9sl3dhr1twv1.statuspage.io/api/v2/summary.json",
);
const scheduleResponseJson = await scheduleResponse.json();

if (!Array.isArray(scheduleResponseJson.scheduled_maintenances)) {
throw new Error("Failed to fetch testnet reset date.");
}

return scheduleResponseJson.scheduled_maintenances;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions src/query/useWasmBinaryFromRpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const useWasmBinaryFromRpc = ({
isActive: boolean;
headers?: NetworkHeaders;
}) => {
const query = useQuery<Buffer | null>({
const query = useQuery({
queryKey: ["useWasmBinaryFromRpc", wasmHash, rpcUrl],
queryFn: async () => {
queryFn: async (): Promise<Buffer | null> => {
if (!wasmHash || !rpcUrl) {
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/query/useWasmGitHubAttestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const useWasmGitHubAttestation = ({
isActive: boolean;
headers?: NetworkHeaders;
}) => {
const query = useQuery<WasmData | null | undefined>({
const query = useQuery({
queryKey: ["useWasmGitHubAttestation", wasmHash, rpcUrl],
queryFn: async () => {
queryFn: async (): Promise<WasmData | null> => {
if (!wasmHash || !rpcUrl) {
return null;
}
Expand Down
Loading