Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renew golden token indexing #279

Merged
merged 5 commits into from
Oct 7, 2024
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
53 changes: 53 additions & 0 deletions ui/src/app/api/getGoldenTokens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Network } from "@/app/hooks/useUIStore";
import { networkConfig } from "@/app/lib/networkConfig";
import { indexAddress } from "@/app/lib/utils";

export const getGoldenTokens = async (
owner: string,
goldenTokenAddress: string,
network: Network
): Promise<number[]> => {
const recursiveFetch: any = async (
goldenTokens: any[],
nextPageKey: string | null
) => {
Comment on lines +10 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Specify explicit types instead of using any

Using any defeats TypeScript's static type checking. Consider defining explicit types for the recursiveFetch function and its parameters to enhance type safety and maintainability.

Apply this diff to specify explicit types:

- const recursiveFetch: any = async (
-   goldenTokens: any[],
-   nextPageKey: string | null
- ) => {
+ const recursiveFetch = async (
+   goldenTokens: number[],
+   nextPageKey: string | null
+ ): Promise<number[]> => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const recursiveFetch: any = async (
goldenTokens: any[],
nextPageKey: string | null
) => {
const recursiveFetch = async (
goldenTokens: number[],
nextPageKey: string | null
): Promise<number[]> => {

let url = `${
networkConfig[network!].blastUrl
}/builder/getWalletNFTs?contractAddress=${goldenTokenAddress}&walletAddress=${indexAddress(
owner
).toLowerCase()}&pageSize=100`;

if (nextPageKey) {
url += `&pageKey=${nextPageKey}`;
}
Comment on lines +10 to +22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve type safety and security in URL construction

  1. Replace any types with explicit types for better type safety.
  2. Add a runtime check for network instead of using non-null assertion.
  3. URL-encode query parameters to prevent injection attacks.

Apply this diff to address these issues:

- const recursiveFetch: any = async (
-   goldenTokens: any[],
+ const recursiveFetch = async (
+   goldenTokens: number[],
  nextPageKey: string | null
- ) => {
+ ): Promise<number[]> => {
+   if (!network) {
+     throw new Error("Network is not defined");
+   }
    let url = `${
-     networkConfig[network!].blastUrl
+     networkConfig[network].blastUrl
-   }/builder/getWalletNFTs?contractAddress=${goldenTokenAddress}&walletAddress=${indexAddress(
-     owner
-   ).toLowerCase()}&pageSize=100`;
+   }/builder/getWalletNFTs?contractAddress=${encodeURIComponent(goldenTokenAddress)}&walletAddress=${encodeURIComponent(indexAddress(owner).toLowerCase())}&pageSize=100`;

    if (nextPageKey) {
-     url += `&pageKey=${nextPageKey}`;
+     url += `&pageKey=${encodeURIComponent(nextPageKey)}`;
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const recursiveFetch: any = async (
goldenTokens: any[],
nextPageKey: string | null
) => {
let url = `${
networkConfig[network!].blastUrl
}/builder/getWalletNFTs?contractAddress=${goldenTokenAddress}&walletAddress=${indexAddress(
owner
).toLowerCase()}&pageSize=100`;
if (nextPageKey) {
url += `&pageKey=${nextPageKey}`;
}
const recursiveFetch = async (
goldenTokens: number[],
nextPageKey: string | null
): Promise<number[]> => {
if (!network) {
throw new Error("Network is not defined");
}
let url = `${
networkConfig[network].blastUrl
}/builder/getWalletNFTs?contractAddress=${encodeURIComponent(goldenTokenAddress)}&walletAddress=${encodeURIComponent(indexAddress(owner).toLowerCase())}&pageSize=100`;
if (nextPageKey) {
url += `&pageKey=${encodeURIComponent(nextPageKey)}`;
}


try {
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});

Comment on lines +24 to +31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve error handling in the fetch request

  1. Add a response status check before parsing JSON.
  2. Enhance error handling to provide more context.

Apply this diff to improve error handling:

  try {
    const response = await fetch(url, {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
      },
    });

+   if (!response.ok) {
+     throw new Error(`HTTP error! Status: ${response.status}`);
+   }

    const data = await response.json();
    // ... rest of the code
  } catch (ex) {
-   console.log("error fetching golden tokens", ex);
+   console.error("Error fetching golden tokens:", ex);
+   throw new Error(`Failed to fetch golden tokens: ${ex.message}`);
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
try {
const response = await fetch(url, {
method: "GET",
headers: {
"Content-Type": "application/json",
},
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
// ... rest of the code
} catch (ex) {
console.error("Error fetching golden tokens:", ex);
throw new Error(`Failed to fetch golden tokens: ${ex.message}`);
}

const data = await response.json();
Comment on lines +25 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add response status check before parsing JSON

Currently, the code assumes that the fetch request is successful and proceeds to parse the response JSON. To handle potential HTTP errors, check response.ok and handle error statuses appropriately before calling response.json().

Apply this diff to add a response status check:

try {
  const response = await fetch(url, {
    method: "GET",
    // headers...
  });

+  if (!response.ok) {
+    throw new Error(`HTTP error! Status: ${response.status}`);
+  }

  const data = await response.json();
  // Process data...

Committable suggestion was skipped due to low confidence.

goldenTokens = goldenTokens.concat(
data?.nfts?.map((goldenToken: any) => {
const tokenId = JSON.parse(goldenToken.tokenId);
return Number(tokenId);
})
Comment on lines +34 to +37
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid unnecessary JSON.parse on goldenToken.tokenId

Using JSON.parse on goldenToken.tokenId may be unnecessary and could lead to errors if tokenId is not valid JSON. If goldenToken.tokenId is a string representation of a number, you can convert it directly using Number(goldenToken.tokenId).

Apply this diff to simplify the code:

const data = await response.json();
goldenTokens = goldenTokens.concat(
  (data?.nfts ?? []).map((goldenToken: any) => {
-    const tokenId = JSON.parse(goldenToken.tokenId);
+    const tokenId = Number(goldenToken.tokenId);
     return tokenId;
  })
);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
data?.nfts?.map((goldenToken: any) => {
const tokenId = JSON.parse(goldenToken.tokenId);
return Number(tokenId);
})
data?.nfts?.map((goldenToken: any) => {
const tokenId = Number(goldenToken.tokenId);
return tokenId;
})

);
Comment on lines +32 to +38
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Handle cases where data.nfts might be undefined

If data.nfts is undefined or null, mapping over it will result in an error. Consider adding a check to ensure data.nfts is an array before mapping over it.

Apply this diff to add a default empty array if data.nfts is undefined:

const data = await response.json();
goldenTokens = goldenTokens.concat(
-   data?.nfts?.map((goldenToken: any) => {
+   (data?.nfts ?? []).map((goldenToken: any) => {
      const tokenId = Number(goldenToken.tokenId);
      return tokenId;
    })
);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const data = await response.json();
goldenTokens = goldenTokens.concat(
data?.nfts?.map((goldenToken: any) => {
const tokenId = JSON.parse(goldenToken.tokenId);
return Number(tokenId);
})
);
const data = await response.json();
goldenTokens = goldenTokens.concat(
(data?.nfts ?? []).map((goldenToken: any) => {
const tokenId = JSON.parse(goldenToken.tokenId);
return Number(tokenId);
})
);


if (data.nextPageKey) {
return recursiveFetch(goldenTokens, data.nextPageKey);
}
} catch (ex) {
console.log("error fetching golden tokens", ex);
}

return goldenTokens;
};
Comment on lines +32 to +48
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Refactor data processing and pagination logic

  1. Add a check for data.nfts before mapping.
  2. Remove unnecessary JSON.parse.
  3. Consider refactoring to an iterative approach for better efficiency and to avoid potential stack overflow.

Apply this diff to address the immediate issues:

  const data = await response.json();
  goldenTokens = goldenTokens.concat(
-   data?.nfts?.map((goldenToken: any) => {
+   (data?.nfts ?? []).map((goldenToken: any) => {
-     const tokenId = JSON.parse(goldenToken.tokenId);
-     return Number(tokenId);
+     return Number(goldenToken.tokenId);
    })
  );

  if (data.nextPageKey) {
    return recursiveFetch(goldenTokens, data.nextPageKey);
  }

Consider refactoring the entire function to use an iterative approach:

const fetchAllPages = async (): Promise<number[]> => {
  let goldenTokens: number[] = [];
  let nextPageKey: string | null = null;
  do {
    // Construct URL (with proper encoding)
    try {
      // Fetch and process data
      // Update nextPageKey
    } catch (ex) {
      console.error("Error fetching golden tokens:", ex);
      break;
    }
  } while (nextPageKey);
  return goldenTokens;
};


let goldenTokenData = await recursiveFetch([], null);

return goldenTokenData;
};
16 changes: 4 additions & 12 deletions ui/src/app/components/start/CreateAdventurer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ export interface CreateAdventurerProps {
isActive: boolean;
onEscape: () => void;
spawn: (...args: any[]) => any;
lordsBalance?: bigint;
goldenTokenData: any;
goldenTokens: number[];
blobertsData: any;
gameContract: Contract;
getBalances: () => Promise<void>;
mintLords: (lordsAmount: number) => Promise<void>;
costToPlay: bigint;
}

export const CreateAdventurer = ({
isActive,
onEscape,
spawn,
lordsBalance,
goldenTokenData,
goldenTokens,
blobertsData,
gameContract,
getBalances,
mintLords,
costToPlay,
}: CreateAdventurerProps) => {
const [formData, setFormData] = useState<FormData>({
Expand Down Expand Up @@ -119,12 +115,10 @@ export const CreateAdventurer = ({
formData={formData}
spawn={spawn}
handleBack={handleBack}
lordsBalance={lordsBalance}
goldenTokenData={goldenTokenData}
goldenTokens={goldenTokens}
blobertsData={blobertsData}
gameContract={gameContract}
getBalances={getBalances}
mintLords={mintLords}
costToPlay={costToPlay}
/>
</div>
Expand All @@ -145,12 +139,10 @@ export const CreateAdventurer = ({
formData={formData}
spawn={spawn}
handleBack={handleBack}
lordsBalance={lordsBalance}
goldenTokenData={goldenTokenData}
goldenTokens={goldenTokens}
blobertsData={blobertsData}
gameContract={gameContract}
getBalances={getBalances}
mintLords={mintLords}
costToPlay={costToPlay}
/>
</div>
Expand Down
17 changes: 4 additions & 13 deletions ui/src/app/components/start/Spawn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import useUIStore from "@/app/hooks/useUIStore";
import { battle } from "@/app/lib/constants";
import { networkConfig } from "@/app/lib/networkConfig";
import { formatLords } from "@/app/lib/utils";
import { Adventurer, FormData, GameToken } from "@/app/types";
import { Adventurer, FormData } from "@/app/types";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Action Required: Remaining References to lordsBalance and goldenTokenData Detected

The following files still reference lordsBalance and goldenTokenData, which need to be updated to align with the recent SpawnProps modifications:

  • lordsBalance:

    • ui/src/app/page.tsx
    • ui/src/app/lib/utils/syscalls.ts
    • ui/src/app/lib/balances.ts
    • ui/src/app/containers/TopUp.tsx
    • ui/src/app/containers/Onboarding.tsx
    • ui/src/app/components/profile/ProfileDialog.tsx
    • ui/src/app/components/navigation/Header.tsx
  • goldenTokenData:

    • ui/src/app/api/getGoldenTokens.ts
  • goldenTokens:

    • ui/src/app/page.tsx
    • ui/src/app/containers/AdventurerScreen.tsx
    • ui/src/app/components/start/CreateAdventurer.tsx
    • ui/src/app/components/start/Spawn.tsx

Please update these references to ensure consistency and type safety across the codebase.

🔗 Analysis chain

Approved: Updated imports and SpawnProps interface

The changes to the imports and SpawnProps interface look good. The addition of Adventurer and FormData types import suggests improved type safety. The modification of SpawnProps to use goldenTokens: number[] instead of goldenTokenData: any is a positive change, as it provides more specific typing and potentially simplifies the component's logic.

To ensure this change is consistently applied throughout the codebase, please run the following script:

Also applies to: 33-37

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining usage of lordsBalance or goldenTokenData in SpawnProps

# Search for lordsBalance in SpawnProps
echo "Checking for lordsBalance in SpawnProps:"
rg --type typescript 'SpawnProps.*lordsBalance'

# Search for goldenTokenData in SpawnProps
echo "Checking for goldenTokenData in SpawnProps:"
rg --type typescript 'SpawnProps.*goldenTokenData'

# Search for usage of goldenTokens in SpawnProps
echo "Checking for goldenTokens in SpawnProps:"
rg --type typescript 'SpawnProps.*goldenTokens'

Length of output: 536


Script:

#!/bin/bash
# Description: Check for any remaining usage of lordsBalance or goldenTokenData in SpawnProps

# Define the search patterns
PATTERNS=("lordsBalance" "goldenTokenData")

# Iterate over each pattern and search in .ts and .tsx files
for pattern in "${PATTERNS[@]}"; do
  echo "Checking for ${pattern} in SpawnProps:"
  rg "${pattern}" --glob "*.ts" --glob "*.tsx"
done

# Additionally, check for usage of goldenTokens in SpawnProps
echo "Checking for goldenTokens in SpawnProps:"
rg "goldenTokens" --glob "*.ts" --glob "*.tsx"

Length of output: 3865

import Image from "next/image";
import Lords from "public/icons/lords.svg";
import { useEffect, useMemo, useState } from "react";
Expand All @@ -30,25 +30,21 @@ export interface SpawnProps {
costToPlay?: number
) => Promise<void>;
handleBack: () => void;
lordsBalance?: bigint;
goldenTokenData: any;
goldenTokens: number[];
blobertsData: any;
gameContract: Contract;
getBalances: () => Promise<void>;
mintLords: (lordsAmount: number) => Promise<void>;
costToPlay: bigint;
}

export const Spawn = ({
formData,
spawn,
handleBack,
lordsBalance,
goldenTokenData,
goldenTokens,
blobertsData,
gameContract,
getBalances,
mintLords,
costToPlay,
}: SpawnProps) => {
const [paymentInitiated, setPaymentInitiated] = useState(false);
Expand Down Expand Up @@ -89,11 +85,6 @@ export const Spawn = ({
}
};

const goldenTokens = goldenTokenData?.getERC721Tokens;
const goldenTokenIds: number[] = goldenTokens?.map(
(token: GameToken) => token.token_id
);

const getUsableGoldenToken = async (tokenIds: number[]) => {
// Loop through contract calls to see if the token is usable, if none then return 0
for (let tokenId of tokenIds) {
Expand Down Expand Up @@ -133,7 +124,7 @@ export const Spawn = ({
const tournamentEnded = process.env.NEXT_PUBLIC_TOURNAMENT_ENDED === "true";

useEffect(() => {
getUsableGoldenToken(goldenTokenIds ?? []);
getUsableGoldenToken(goldenTokens ?? []);
if (tournamentEnded) {
getUsableBlobertToken(blobertTokenIds ?? []);
}
Expand Down
12 changes: 3 additions & 9 deletions ui/src/app/containers/AdventurerScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ interface AdventurerScreenProps {
costToPlay?: number
) => Promise<void>;
handleSwitchAdventurer: (adventurerId: number) => Promise<void>;
lordsBalance?: bigint;
gameContract: Contract;
goldenTokenData: any;
goldenTokens: number[];
blobertsData: any;
getBalances: () => Promise<void>;
mintLords: (lordsAmount: number) => Promise<void>;
costToPlay: bigint;
transferAdventurer: (
account: AccountInterface,
Expand All @@ -46,12 +44,10 @@ interface AdventurerScreenProps {
export default function AdventurerScreen({
spawn,
handleSwitchAdventurer,
lordsBalance,
gameContract,
goldenTokenData,
goldenTokens,
blobertsData,
getBalances,
mintLords,
costToPlay,
transferAdventurer,
}: AdventurerScreenProps) {
Expand Down Expand Up @@ -137,12 +133,10 @@ export default function AdventurerScreen({
isActive={activeMenu == 1}
onEscape={() => setActiveMenu(0)}
spawn={spawn}
lordsBalance={lordsBalance}
goldenTokenData={goldenTokenData}
goldenTokens={goldenTokens}
blobertsData={blobertsData}
gameContract={gameContract}
getBalances={getBalances}
mintLords={mintLords}
costToPlay={costToPlay}
/>
</div>
Expand Down
14 changes: 3 additions & 11 deletions ui/src/app/hooks/useCustomQuery.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { useEffect, useCallback, useMemo } from "react";
import { useQuery } from "@apollo/client";
import { useQueriesStore, QueryKey } from "@/app/hooks/useQueryStore";
import { gameClient } from "@/app/lib/clients";
import { QueryKey, useQueriesStore } from "@/app/hooks/useQueryStore";
import { Network } from "@/app/hooks/useUIStore";
import { networkConfig } from "@/app/lib/networkConfig";
import { useQuery } from "@apollo/client";
import { useCallback, useEffect } from "react";

type Variables = Record<
string,
Expand All @@ -21,13 +19,7 @@ const useCustomQuery = (
setRefetch: state.setRefetch,
}));

// Memoize the Apollo Client instance based on clientType
const client = useMemo(() => {
return gameClient(networkConfig[network!].lsGQLURL);
}, [network]);

const { data, refetch } = useQuery(query, {
client: client,
variables: variables,
skip: skip,
});
Expand Down
34 changes: 15 additions & 19 deletions ui/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
"use client";

import { useEffect, useState } from "react";
import { ApolloProvider } from "@apollo/client";
import BurnerLoader from "@/app/components/animations/BurnerLoader";
import Intro from "@/app/components/intro/Intro";
import LoginIntro from "@/app/components/onboarding/Intro";
Comment on lines +3 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Clarify Component Naming to Avoid Confusion

The imports on lines 3-5 include both Intro and LoginIntro components:

import BurnerLoader from "@/app/components/animations/BurnerLoader";
import Intro from "@/app/components/intro/Intro";
import LoginIntro from "@/app/components/onboarding/Intro";

Having components with similar names can lead to confusion and maintainability issues. Consider renaming LoginIntro to a more descriptive name that reflects its specific purpose, or organizing them in a way that distinguishes their roles clearly.

import { ControllerProvider } from "@/app/context/ControllerContext";
import { gameClient, goldenTokenClient } from "@/app/lib/clients";
import useUIStore from "@/app/hooks/useUIStore";
import { StarknetProvider } from "@/app/provider";
import { DojoProvider } from "@/app/dojo/DojoContext";
import { setup } from "@/app/dojo/setup";
import LoginIntro from "@/app/components/onboarding/Intro";
import Intro from "@/app/components/intro/Intro";
import "@/app/globals.css";
import { BurnerManager } from "@dojoengine/create-burner";
import { RpcProvider } from "starknet";
import Head from "@/app/head";
import useUIStore from "@/app/hooks/useUIStore";
import { gameClient } from "@/app/lib/clients";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure lsGQLURL is Defined for All Networks

On line 12, the gameClient is imported:

import { gameClient } from "@/app/lib/clients";

Later, in the ApolloProvider, gameClient is called with:

<ApolloProvider client={gameClient(networkConfig[network].lsGQLURL!)}>

The exclamation mark ! asserts that lsGQLURL is not undefined. To prevent potential runtime errors, verify that lsGQLURL is defined for all possible values of network in networkConfig. If there's a chance that lsGQLURL could be undefined, include appropriate error handling or validation before using it.

import { StarknetProvider } from "@/app/provider";
import { ApolloProvider } from "@apollo/client";
import { BurnerManager } from "@dojoengine/create-burner";
import { Analytics } from "@vercel/analytics/react";
import BurnerLoader from "@/app/components/animations/BurnerLoader";
import { useEffect, useState } from "react";
import { RpcProvider } from "starknet";
import { networkConfig } from "./lib/networkConfig";

type SetupResult = {
Expand Down Expand Up @@ -83,15 +83,11 @@ export default function RootLayout({
</main>
) : (
<ApolloProvider client={gameClient(networkConfig[network].lsGQLURL!)}>
<ApolloProvider
client={goldenTokenClient(networkConfig[network].tokensGQLURL)}
>
<ControllerProvider>
<StarknetProvider network={network}>
<DojoProvider value={setupResult}>{children}</DojoProvider>
</StarknetProvider>
</ControllerProvider>
</ApolloProvider>
<ControllerProvider>
<StarknetProvider network={network}>
<DojoProvider value={setupResult}>{children}</DojoProvider>
</StarknetProvider>
</ControllerProvider>
</ApolloProvider>
)}
</body>
Expand Down
10 changes: 6 additions & 4 deletions ui/src/app/lib/networkConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export const networkConfig = {
rpcUrl:
"https://starknet-sepolia.blastapi.io/5ef61753-e7c1-4593-bc62-97fdf96f8de5",
lsGQLURL: "https://ls-indexer-sepolia.provable.games/graphql",
tokensGQLURL: "https://testnet.realms.world/api/graphql",
blastUrl:
"https://starknet-mainnet.blastapi.io/5ef61753-e7c1-4593-bc62-97fdf96f8de5",
ethAddress:
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
gameAddress:
Expand Down Expand Up @@ -35,7 +36,8 @@ export const networkConfig = {
mainnet: {
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet",
lsGQLURL: "https://ls-indexer-sepolia.provable.games/graphql",
tokensGQLURL: "https://realms.world/api/graphql",
blastUrl:
"https://starknet-mainnet.blastapi.io/5ef61753-e7c1-4593-bc62-97fdf96f8de5",
ethAddress:
"0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
gameAddress:
Expand Down Expand Up @@ -73,7 +75,7 @@ export const networkConfig = {
katana: {
rpcUrl: "https://ls-katana.provable.games:5443/",
lsGQLURL: "https://ls-katana.provable.games:8080/graphql",
tokensGQLURL: "",
blastUrl: "",
ethAddress: "0x0",
gameAddress:
"0x075cecf3e76521c1b925a640b3f802294e67db09072d9b98090aff55a68e0e3f",
Expand Down Expand Up @@ -102,7 +104,7 @@ export const networkConfig = {
rpcUrl: "http://localhost:5050",
rpcAPIKey: "",
lsGQLURL: "http://localhost:8080/graphql",
tokensGQLURL: "",
blastUrl: "",
ethAddress: "0x0",
gameAddress:
"0x0047339334c614ce3dd6ce0321dfc81c87a1c523fc10b755f162ac7bc4b60342",
Expand Down
Loading
Loading