diff --git a/packages/frontend/src/app/games/[tier_id]/connect-four/components/Game.tsx b/packages/frontend/src/app/games/[tier_id]/connect-four/components/Game.tsx index 274d4d3..36ce7bb 100644 --- a/packages/frontend/src/app/games/[tier_id]/connect-four/components/Game.tsx +++ b/packages/frontend/src/app/games/[tier_id]/connect-four/components/Game.tsx @@ -394,8 +394,8 @@ export default dynamic( ))}
- {gameState.board.flatMap((row) => - row.map((cell) => ), + {gameState.board.flatMap((row, i) => + row.map((cell) => ), )}
{enemy && ( @@ -447,7 +447,9 @@ export default dynamic( tier_id={tier_id} // ! Todo: Add game id to the staking modal game_id={ - "0xbca4cc033c6fc7a4eebc355a0473e863ef63427291fb322d24139fd430f87e4e" + gameState.state === "staking" + ? gameState.room_id + : "" } onSuccess={() => { if (gameState.state !== "staking") return; diff --git a/packages/frontend/src/app/games/[tier_id]/rock-paper-scissors/components/Game.tsx b/packages/frontend/src/app/games/[tier_id]/rock-paper-scissors/components/Game.tsx index a112460..6778d1e 100644 --- a/packages/frontend/src/app/games/[tier_id]/rock-paper-scissors/components/Game.tsx +++ b/packages/frontend/src/app/games/[tier_id]/rock-paper-scissors/components/Game.tsx @@ -441,7 +441,9 @@ export default dynamic( tier_id={tier_id} // ! Todo: Add game id to the staking modal game_id={ - "0xbca4cc033c6fc7a4eebc355a0473e863ef63427291fb322d24139fd430f87e4e" + gameState.state === "staking" + ? gameState.room_id + : "" } onSuccess={() => { if (gameState.state !== "staking") return; diff --git a/packages/frontend/src/utils/functions/ethers.ts b/packages/frontend/src/utils/functions/ethers.ts index 67ddf5b..1074c26 100644 --- a/packages/frontend/src/utils/functions/ethers.ts +++ b/packages/frontend/src/utils/functions/ethers.ts @@ -5,38 +5,38 @@ import { createWalletClient, custom, WalletClient } from "viem"; import { sepolia } from "viem/chains"; export const getWalletClient = async ( - provider: IProvider + provider: IProvider, ): Promise => { - console.log("provider", provider); - const walletClient = createWalletClient({ - chain: sepolia, - transport: custom(provider), - }); + console.log("provider", provider); + const walletClient = createWalletClient({ + chain: sepolia, + transport: custom(provider), + }); - return walletClient; + return walletClient; }; export const getWalletAddress = async ( - provider: IProvider + provider: IProvider, ): Promise => { - const walletClient = new ethers.BrowserProvider(provider); - const walletAddress = (await walletClient.provider.getSigner()).address; + const walletClient = new ethers.BrowserProvider(provider); + const walletAddress = (await walletClient.provider.getSigner()).address; - return walletAddress; + return walletAddress; }; export const getTokenBalance = async ( - provider: IProvider, - walletAddress: string, - tokenAddress: string + provider: IProvider, + walletAddress: string, + tokenAddress: string, ): Promise => { - const walletClient = new ethers.BrowserProvider(provider); - const contract = new ethers.Contract( - tokenAddress, - Contracts.ERC_20_ABI, - walletClient.provider - ); - const balance = await contract.balanceOf(walletAddress); + const walletClient = new ethers.BrowserProvider(provider); + const contract = new ethers.Contract( + tokenAddress, + Contracts.ERC_20_ABI, + walletClient.provider, + ); + const balance = await contract.balanceOf(walletAddress); - return (Number(balance) / Math.pow(10, 6)).toString(); + return (Number(balance) / Math.pow(10, 6)).toString(); }; diff --git a/packages/frontend/src/utils/service/arcade-contract.service.ts b/packages/frontend/src/utils/service/arcade-contract.service.ts index 45db238..ffbadcd 100644 --- a/packages/frontend/src/utils/service/arcade-contract.service.ts +++ b/packages/frontend/src/utils/service/arcade-contract.service.ts @@ -13,7 +13,6 @@ export class ArcadeService { chain_id: number, ): Promise { try { - console.log(chain_id); console.log("Initializing ArcadeService"); console.log("Provider: ", provider); this.provider = new ethers.BrowserProvider(provider);