diff --git a/client/.env b/client/.env index 12719e8d..b3688439 100644 --- a/client/.env +++ b/client/.env @@ -7,7 +7,7 @@ VITE_DEV=YOUR_DEV_VALUE VITE_PUBLIC_DEPLOY_TYPE="sepolia" VITE_PUBLIC_NODE_URL="https://api.cartridge.gg/x/starknet/sepolia" -VITE_PUBLIC_TORII="https://api.cartridge.gg/x/toriibbtest/torii" +VITE_PUBLIC_TORII="https://api.cartridge.gg/x/tamatorii/torii" VITE_PUBLIC_MASTER_ADDRESS="0x04CDA1a7c67aC385Cd0a399D65c405E6539Cc3730c37Cc2C4a62b2F719CD1C0A" VITE_PUBLIC_MASTER_PRIVATE_KEY="0x056ed1031da41a9746534ff13bfd6e86e2071635b3408e49698443f3758c862e" VITE_PUBLIC_SLOT_ADDRESS="https://api.cartridge.gg/x/bytebeaststamagotchi/katana" diff --git a/client/dev-dist/sw.js b/client/dev-dist/sw.js index e955509a..1b48f256 100644 --- a/client/dev-dist/sw.js +++ b/client/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-20a2f87f'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.90s8ruuoado" + "revision": "0.trl9dgsmccg" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { diff --git a/client/src/components/FlappyBeasts/flappyBeasts.tsx b/client/src/components/FlappyBeasts/flappyBeasts.tsx index 9ec4fee0..242b5ed1 100644 --- a/client/src/components/FlappyBeasts/flappyBeasts.tsx +++ b/client/src/components/FlappyBeasts/flappyBeasts.tsx @@ -171,7 +171,6 @@ const FlappyBirdMiniGame = forwardRef(({ async () => { await client.player.updatePlayerTotalPoints(account, score); const txtest = await client.achieve.achievePlayerNewTotalPoints(account); - console.info('achievePlayerNewTotalPoints fkaooy', txtest); await client.player.updatePlayerMinigameHighestScore(account, score, 2); await client.player.addOrUpdateFoodAmount(account, foodId, foodCollected); }); @@ -218,7 +217,6 @@ const FlappyBirdMiniGame = forwardRef(({ if (score > actualHighScore) { setCurrentHighScore(score); const tx = await client.achieve.achieveFlappyBeastHighscore(account as Account, score); - console.info('tx flappy highscore', tx); } else { setCurrentHighScore(actualHighScore); } diff --git a/client/src/components/SkyJumpMiniGame/index.tsx b/client/src/components/SkyJumpMiniGame/index.tsx index 817d82bb..bc1700bd 100644 --- a/client/src/components/SkyJumpMiniGame/index.tsx +++ b/client/src/components/SkyJumpMiniGame/index.tsx @@ -94,7 +94,6 @@ const CanvasSkyJumpGame = forwardRef dojoHighScore) { setCurrentHighScore(engineFinalScore); const tx = await client.achieve.achievePlatformHighscore(account as Account, engineFinalScore); - console.info('tx sky jump achievePlatformHighscore', tx); } else { setCurrentHighScore(dojoHighScore); } @@ -198,17 +197,10 @@ const CanvasSkyJumpGame = forwardRef { - const updatePlayerTotalPoints = await client.player.updatePlayerTotalPoints(account, score); - console.info('updatePlayerTotalPoints', updatePlayerTotalPoints); - - const updatePlayerMinigameHighestScore = await client.player.updatePlayerMinigameHighestScore(account, score, GameId.SKY_JUMP); - console.info('updatePlayerMinigameHighestScore', updatePlayerMinigameHighestScore); - - const addOrUpdateFoodAmount = await client.player.addOrUpdateFoodAmount(account, foodId, foodCollected); - console.info('addOrUpdateFoodAmount', addOrUpdateFoodAmount); - - const achievePlayerNewTotalPoints = await client.achieve.achievePlayerNewTotalPoints(account); - console.info('achievePlayerNewTotalPoints', achievePlayerNewTotalPoints); + await client.player.updatePlayerTotalPoints(account, score); + await client.player.updatePlayerMinigameHighestScore(account, score, GameId.SKY_JUMP); + await client.player.addOrUpdateFoodAmount(account, foodId, foodCollected); + await client.achieve.achievePlayerNewTotalPoints(account); } ); return true; diff --git a/client/src/components/SpawnBeast/index.tsx b/client/src/components/SpawnBeast/index.tsx index 64188a9d..2f9c9ea0 100644 --- a/client/src/components/SpawnBeast/index.tsx +++ b/client/src/components/SpawnBeast/index.tsx @@ -1,8 +1,8 @@ // React and external libraries -import { useEffect, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { useNavigate, useSearchParams } from 'react-router-dom'; import { useAccount } from "@starknet-react/core"; -import { Account } from "starknet"; +import { Account, addAddressPadding } from "starknet"; import { useDojoSDK } from "@dojoengine/sdk/react"; // Internal components @@ -13,14 +13,13 @@ import ProgressBar from '../ProgressBar/index.tsx'; // Hooks and Contexts import { useSystemCalls } from "../../dojo/useSystemCalls.ts"; import { usePlayer } from "../../hooks/usePlayers.tsx"; -import { fetchBeastsData, processBeastData } from "../../hooks/useBeasts"; +import { useBeasts, fetchBeastsData } from "../../hooks/useBeasts"; // Types import type { SpawnBeastProps, SpawnBeastState } from '../../types/components'; -import type { Beast } from '../../types/game'; // Utils import { getRandomNumber } from './utils/helpers'; @@ -38,7 +37,14 @@ const SpawnBeast: React.FC = ({ className = '' }) => { const { spawn } = useSystemCalls(); const navigate = useNavigate(); const [searchParams] = useSearchParams(); - + + const userAddress = useMemo(() => + account ? addAddressPadding(account.address).toLowerCase() : '', + [account] + ); + + const { myBeastsData, refetch } = useBeasts(userAddress); + // State const [state, setState] = useState({ loading: false, @@ -73,8 +79,7 @@ const SpawnBeast: React.FC = ({ className = '' }) => { if (!player) { setSpawnProgress({ progress: 20, message: 'Creating player account' }); const spawnPlayerTx = await client.player.spawnPlayer(account as Account); - console.info('spawnPlayerTx', spawnPlayerTx); - + // Esperar un momento para que se actualice el player await new Promise(resolve => setTimeout(resolve, 2000)); setSpawnProgress({ progress: 40, message: 'Player account created!' }); @@ -83,24 +88,17 @@ const SpawnBeast: React.FC = ({ className = '' }) => { setSpawnProgress({ progress: 50, message: 'Generating your beast' }); const randomBeastId = getRandomNumber(MIN_BEAST_ID, MAX_BEAST_ID); const { spawnTx } = await spawn(randomBeastId); + await new Promise(resolve => setTimeout(resolve, 2000)); if (spawnTx && spawnTx.code === "SUCCESS") { + refetch(); + const beastsData = await fetchBeastsData(); + console.log('beastsData', beastsData); setSpawnProgress({ progress: 70, message: 'Beast generated! Setting as current' }); - let newBeast; - do { - // Recargar la lista de beasts usando GraphQL - const beastsData = await fetchBeastsData(); - const processedBeasts = await processBeastData(beastsData); - - // Encontrar la bestia recién creada - newBeast = processedBeasts.find((beast: Beast) => beast.player === account!.address); - await new Promise(resolve => setTimeout(resolve, 2000)); - } while (!newBeast); - + const newBeast = myBeastsData[0]; if (newBeast) { setSpawnProgress({ progress: 90, message: 'Finalizing setup' }); const setCurrentTx = await client.player.setCurrentBeast(account!, newBeast.beast_id); - console.info('setCurrentTx', setCurrentTx); await new Promise(resolve => setTimeout(resolve, 2000)); setSpawnProgress({ progress: 100, message: 'Your beast is ready!' }); setTimeout(() => { diff --git a/client/src/components/Tamagotchi/Play/index.tsx b/client/src/components/Tamagotchi/Play/index.tsx index 200e72cb..be2b01cf 100644 --- a/client/src/components/Tamagotchi/Play/index.tsx +++ b/client/src/components/Tamagotchi/Play/index.tsx @@ -31,8 +31,6 @@ const Play: React.FC = ({ }) => { const navigate = useNavigate(); const { myScoreFlappyBird, myScoreSkyJump } = useHighScores(); - console.info('myScoreFlappyBird', myScoreFlappyBird); - console.info('myScoreSkyJump', myScoreSkyJump); const GAME_ID_MAPPING: Record = { 'doodleGame': 1, // SkyJump @@ -50,7 +48,6 @@ const Play: React.FC = ({ try { const tx = await client.achieve.achievePlayMinigame(account); - console.info('tx achievePlayMinigame', tx); handleAction( "Play", diff --git a/client/src/components/Twitter/ShareProgress.tsx b/client/src/components/Twitter/ShareProgress.tsx index f4fa7a41..a1f6583b 100644 --- a/client/src/components/Twitter/ShareProgress.tsx +++ b/client/src/components/Twitter/ShareProgress.tsx @@ -104,10 +104,8 @@ export const ShareProgress: React.FC = ({ e.stopPropagation(); if (minigameData) { const tx = await client.achieve.achieveScoreShare(account, minigameData.score); - console.info('achieveScoreShare ', tx) } else { const tx = await client.achieve.achieveBeastShare(account); - console.info('achieveBeastShare ', tx) } }} > diff --git a/client/src/config/cartridgeConnector.tsx b/client/src/config/cartridgeConnector.tsx index c7689408..3a5489f0 100644 --- a/client/src/config/cartridgeConnector.tsx +++ b/client/src/config/cartridgeConnector.tsx @@ -4,11 +4,11 @@ import { ColorMode, SessionPolicies, ControllerOptions, } from "@cartridge/contr import { constants } from "starknet"; const { VITE_PUBLIC_DEPLOY_TYPE } = import.meta.env; -const { VITE_PUBLIC_SLOT_ADDRESS } = import.meta.env; const CONTRACT_ADDRESS_ACHIEVEMENTS = '0x1005116a48c9a8f7a6c946091e64dc8ced37962dc2bbb74355868229307c20d' const CONTRACT_ADDRESS_TAMAGOTCHI_SYSTEM = '0x58971d723d0100ae8393550f9166c9dad9b79799a48fc31f0d9684ef556dda9' const CONTRACT_ADDRESS_PLAYER_SYSTEM = '0x6b7b30fcd29c41bca831b87db67e3c8af2abb374dc2fabbbf09f4744aa22988' +const VRF_PROVIDER_ADDRESS = '0x051fea4450da9d6aee758bdeba88b2f665bcbf549d2c61421aa724e9ac0ced8f'; const policies: SessionPolicies = { contracts: { @@ -25,7 +25,7 @@ const policies: SessionPolicies = { { name: "play", entrypoint: "play" }, { name: "revive", entrypoint: "revive" }, { name: "sleep", entrypoint: "sleep" }, - { name: "spawn_beast", entrypoint: "spawn_beast" }, + // { name: "spawn_beast", entrypoint: "spawn_beast" }, { name: "update_beast", entrypoint: "update_beast" }, { name: "update_food_amount", entrypoint: "update_food_amount" }, ], @@ -116,25 +116,22 @@ const policies: SessionPolicies = { }, ], }, + + // [VRF_PROVIDER_ADDRESS]: { + // methods: [ + // { + // name: "request_random", + // entrypoint: "request_random", + // description: "Allows requesting random numbers from the VRF provider" + // }, + // ], + // }, }, } // Controller basic configuration const colorMode: ColorMode = "dark"; const theme = "bytebeasts-tamagotchi"; -const namespace = "tamagotchi"; //ensure this is correct -const slot = `bytebeasts-tamagotchi-${VITE_PUBLIC_DEPLOY_TYPE || 'dev'}`; //ensure bytebeasts-tamagotchi this is correct - -const getRpcUrl = () => { - switch (VITE_PUBLIC_DEPLOY_TYPE) { - case "mainnet": - return "https://api.cartridge.gg/x/starknet/mainnet"; - case "sepolia": - return "https://api.cartridge.gg/x/starknet/sepolia"; - default: - return VITE_PUBLIC_SLOT_ADDRESS; - } -}; const options: ControllerOptions = { // @ts-ignore @@ -149,7 +146,7 @@ const options: ControllerOptions = { colorMode, preset: "bytebeasts-tamagotchi", namespace: "tamagotchi", - slot: "toriibbtest" + slot: "tamatorii" }; const cartridgeConnector = new ControllerConnector( diff --git a/client/src/dojo/bindings.ts b/client/src/dojo/bindings.ts index 86351c20..aa8b6e45 100644 --- a/client/src/dojo/bindings.ts +++ b/client/src/dojo/bindings.ts @@ -21,6 +21,7 @@ export interface BeastValue { // Type definition for `tamagotchi::models::beast_status::BeastStatus` struct export interface BeastStatus { beast_id: number; + player: string; is_alive: boolean; is_awake: boolean; hunger: number; @@ -33,6 +34,7 @@ export interface BeastStatus { // Type definition for `tamagotchi::models::beast_status::BeastStatusValue` struct export interface BeastStatusValue { + player: string; is_alive: boolean; is_awake: boolean; hunger: number; @@ -190,6 +192,7 @@ export const schema: SchemaType = { }, BeastStatus: { beast_id: 0, + player: "", is_alive: false, is_awake: false, hunger: 0, @@ -200,6 +203,7 @@ export const schema: SchemaType = { last_timestamp: 0, }, BeastStatusValue: { + player: "", is_alive: false, is_awake: false, hunger: 0, diff --git a/client/src/dojo/dojoConfig.ts b/client/src/dojo/dojoConfig.ts index 1cfea225..88dd622b 100644 --- a/client/src/dojo/dojoConfig.ts +++ b/client/src/dojo/dojoConfig.ts @@ -14,5 +14,5 @@ export const dojoConfig = createDojoConfig({ masterAddress: VITE_PUBLIC_MASTER_ADDRESS || '0x04CDA1a7c67aC385Cd0a399D65c405E6539Cc3730c37Cc2C4a62b2F719CD1C0A', masterPrivateKey: VITE_PUBLIC_MASTER_PRIVATE_KEY || '0x056ed1031da41a9746534ff13bfd6e86e2071635b3408e49698443f3758c862e', rpcUrl: VITE_PUBLIC_NODE_URL || 'https://api.cartridge.gg/x/starknet/sepolia', - toriiUrl: VITE_PUBLIC_TORII || 'https://api.cartridge.gg/x/toriibbtest/torii', + toriiUrl: VITE_PUBLIC_TORII || 'https://api.cartridge.gg/x/tamatorii/torii', }); diff --git a/client/src/dojo/manifest_dev.json b/client/src/dojo/manifest_dev.json index 41d22618..5d362e61 100644 --- a/client/src/dojo/manifest_dev.json +++ b/client/src/dojo/manifest_dev.json @@ -1,8 +1,8 @@ { "world": { "class_hash": "0x7c9469d45a9cdbab775035afb48e1fa73fb35ab059fcb9dfb0a301aa973e783", - "address": "0x55ab491f46e96bfdbefab82c7ff1101bf8fd10bdb4e47c01533bc2a2a1e9e9e", - "seed": "tamagotchi17", + "address": "0x7220cd7725010ad17892773ffcca9347fcd2c899171a4df67b740196ec0a1d6", + "seed": "tamagotchi19", "name": "ByteBeasts Tamagotchi", "entrypoints": [ "uuid", @@ -1312,7 +1312,7 @@ }, "contracts": [ { - "address": "0x1005116a48c9a8f7a6c946091e64dc8ced37962dc2bbb74355868229307c20d", + "address": "0x7b0cb70509a095f27b9d1187c433421b8cb2e731366f0ee8b27fd48dbf149fc", "class_hash": "0x2ae3f43544bc745744f339fffc5390aac05e3a99f16aadba70859ecd5b46116", "abi": [ { @@ -1614,8 +1614,8 @@ ] }, { - "address": "0x58971d723d0100ae8393550f9166c9dad9b79799a48fc31f0d9684ef556dda9", - "class_hash": "0x42f4064e1316913658aa9097a3275f68b9d11d7c5282dfb026f78a6d61a25db", + "address": "0x5f40f5c23253d2f4d22849880c89483df6a7f22a3f3b2fa4c88d0476a27d5de", + "class_hash": "0x52a9790e907235c127df5560cc2f89064188a5639fd1a0cd40fc9b9e9a646d9", "abi": [ { "type": "impl", @@ -1739,6 +1739,10 @@ "type": "struct", "name": "tamagotchi::models::beast_status::BeastStatus", "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, { "name": "beast_id", "type": "core::integer::u16" @@ -2065,7 +2069,7 @@ ] }, { - "address": "0x6b7b30fcd29c41bca831b87db67e3c8af2abb374dc2fabbbf09f4744aa22988", + "address": "0x6ac1c61c0fbdeca534ab1791b138da22b20d6b3a3c82de01b2bb804d35a4756", "class_hash": "0x24eeedaa48d3c3de399ec22d854f14c3533170902e21c18c8fc6e3bb8187a0d", "abi": [ { @@ -2352,7 +2356,7 @@ }, { "members": [], - "class_hash": "0x2d33cad545c3e9b01b8a328418c0bc5dc529ec0abb1f3f4efa18f10c3bfb837", + "class_hash": "0x52dfc0a351c1b7770289b2f14d2dfcf0d8b4b5586872efaef763105be4808be", "tag": "tamagotchi-BeastStatus", "selector": "0x7dd28052791e63bdc06d6ba2a8eca548b4580c2e83bb96c03ef0a2d84f8ffde" }, @@ -2396,4 +2400,4 @@ } ], "external_contracts": [] -} \ No newline at end of file +} diff --git a/client/src/dojo/useSystemCalls.ts b/client/src/dojo/useSystemCalls.ts index c7b7deb1..b54b4c34 100644 --- a/client/src/dojo/useSystemCalls.ts +++ b/client/src/dojo/useSystemCalls.ts @@ -3,47 +3,75 @@ import { v4 as uuidv4 } from "uuid"; import { useAccount } from "@starknet-react/core"; import { useDojoSDK } from "@dojoengine/sdk/react"; +const VRF_PROVIDER_ADDRESS = '0x051fea4450da9d6aee758bdeba88b2f665bcbf549d2c61421aa724e9ac0ced8f'; +const GAME_CONTRACT = '0x58971d723d0100ae8393550f9166c9dad9b79799a48fc31f0d9684ef556dda9'; + export const useSystemCalls = () => { - const { useDojoStore, client } = useDojoSDK(); + const { useDojoStore, provider } = useDojoSDK(); const state = useDojoStore((state) => state); - const { account } = useAccount(); - /** - * Generates a unique entity ID based on the current account address. - * @returns {string} The generated entity ID - */ - // const generateEntityId = () => { - // return getEntityIdFromKeys([BigInt(account!.address)]); - // }; - - /** - * Spawns a new entity with initial moves and handles optimistic updates. - * @returns {Promise} - * @throws {Error} If the spawn action fails - */ - const spawn = async (randomNumber:number) => { + const handleTransaction = async ( + action: () => Promise<{ transaction_hash: string }>, + successMessage: string + ) => { const transactionId = uuidv4(); try { - // Execute the spawn action from the client - const spawnTx = await client.game.spawnBeast(account!, randomNumber, randomNumber); + // Execute the transaction + const { transaction_hash } = await action(); + console.log("transaction_hash", transaction_hash); + + // Wait for completion + const transaction = await account?.waitForTransaction(transaction_hash, { + retryInterval: 200, + }); + + // Confirm the transaction if successful + state.confirmTransaction(transactionId); - return { - spawnTx, - }; + return transaction; } catch (error) { // Revert the optimistic update if an error occurs state.revertOptimisticUpdate(transactionId); - console.error("Error executing spawn:", error); + console.error("Error executing transaction:", error); throw error; - } finally { - // Confirm the transaction if successful - state.confirmTransaction(transactionId); } }; - return { - spawn, + const spawn = async (randomNumber: number) => { + if (!account || !provider) return; + + return await handleTransaction( + async () => { + const spawnTx = await provider.execute( + account as any, + [ + { + contractAddress: VRF_PROVIDER_ADDRESS, + entrypoint: 'request_random', + calldata: [ + GAME_CONTRACT, // caller + 0, // type: 0 para Source::Nonce + account.address // address para Source::Nonce + ] + }, + { + contractName: "game", + entrypoint: "spawn_beast", + calldata: [randomNumber, randomNumber] // El contrato usará consume_random internamente + } + ], + "tamagotchi", // namespace que ya tienes configurado + { maxFee: 1e15 } + ); + console.info('spawnTx roloooo', spawnTx); + + return spawnTx; + }, + "Beast spawned successfully!" + ); }; + + return { spawn }; }; diff --git a/client/src/hooks/useBeasts.tsx b/client/src/hooks/useBeasts.tsx index e794d982..c4370d43 100644 --- a/client/src/hooks/useBeasts.tsx +++ b/client/src/hooks/useBeasts.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from "react"; import { dojoConfig } from "../dojo/dojoConfig"; import { lookupAddresses } from '@cartridge/controller'; -import { Beast, BeastEdge, BeastStatus, BeastStatusEdge, BeastStatuses } from '../types/game'; - +import { Beast, BeastEdge, BeastStatusEdge, BeastStatuses } from '../types/game'; + // Constants const TORII_URL = dojoConfig.toriiUrl + "/graphql"; const BEASTS_QUERY = ` @@ -31,6 +31,24 @@ const BEASTS_QUERY = ` } `; +const MY_BEASTS = (address: string) => ` + query GetBeastsByContract() { + tamagotchiBeastModels(where: { player: "${address}"}) { + edges { + node { + beast_id + birth_date + player + age + specie + beast_type + } + } + totalCount + } + } +`; + // API Functions export const fetchBeastsData = async (): Promise => { try { @@ -52,6 +70,26 @@ export const fetchBeastsData = async (): Promise => { } }; +export const fetchMyBeastsData = async (contractAddress: string): Promise => { + try { + const response = await fetch(TORII_URL, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ query: MY_BEASTS(contractAddress) }), + }); + + const result = await response.json(); + if (!result.data?.tamagotchiBeastModels) { + throw new Error('No beast data found'); + } + + return result.data; + } catch (error) { + console.error("Error fetching my beasts:", error); + throw error; + } +}; + export const processBeastData = async (data: any): Promise => { const playerAddresses = data.tamagotchiBeastModels.edges .map((edge: BeastEdge) => edge.node.player) @@ -85,18 +123,29 @@ const extractBeastStatuses = (statusModels: any): BeastStatuses => { }; // Hook -export const useBeasts = () => { +export const useBeasts = (userAddress?: string) => { const [beastsData, setBeastsData] = useState([]); + const [myBeastsData, setMyBeastsData] = useState([]); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); + const [trigger, setTrigger] = useState(0); useEffect(() => { const loadBeasts = async () => { try { setIsLoading(true); - const data = await fetchBeastsData(); - const processedData = await processBeastData(data); - setBeastsData(processedData); + const [allBeastsData, myBeasts] = await Promise.all([ + fetchBeastsData(), + userAddress ? fetchMyBeastsData(userAddress) : Promise.resolve(null) + ]); + + const processedAllBeasts = await processBeastData(allBeastsData); + setBeastsData(processedAllBeasts); + + if (myBeasts) { + const processedMyBeasts = await processBeastData(myBeasts); + setMyBeastsData(processedMyBeasts); + } } catch (err) { setError(err instanceof Error ? err : new Error('Unknown error occurred')); } finally { @@ -105,11 +154,17 @@ export const useBeasts = () => { }; loadBeasts(); - }, []); + }, [userAddress, trigger]); + + const refetch = () => { + setTrigger(prev => prev + 1); + }; return { beastsData, + myBeastsData, isLoading, - error + error, + refetch }; }; diff --git a/client/src/hooks/useHighScore.tsx b/client/src/hooks/useHighScore.tsx index e54546ba..53af0eba 100644 --- a/client/src/hooks/useHighScore.tsx +++ b/client/src/hooks/useHighScore.tsx @@ -77,8 +77,6 @@ export const useHighScores = () => { const allScores = processHighScores(scoreEdges); setScores(allScores); - console.info('allScores', allScores); - if (userAddress) { const skyJumpScores = filterScoresByGameAndUser( allScores, diff --git a/client/vite.config.ts b/client/vite.config.ts index 7bc4d95b..2936a810 100644 --- a/client/vite.config.ts +++ b/client/vite.config.ts @@ -3,15 +3,15 @@ import topLevelAwait from "vite-plugin-top-level-await"; import { defineConfig } from "vite"; import { VitePWA } from "vite-plugin-pwa"; import wasm from "vite-plugin-wasm"; -//import fs from "fs"; +import fs from "fs"; export default defineConfig({ - // server: { - // https: { - // key: fs.readFileSync("mkcert+1-key.pem"), // Path to private key file - // cert: fs.readFileSync("mkcert+1.pem"), // Path to certificate file - // }, - // }, + server: { + https: { + key: fs.readFileSync("mkcert+1-key.pem"), // Path to private key file + cert: fs.readFileSync("mkcert+1.pem"), // Path to certificate file + }, + }, plugins: [ react(), wasm(), diff --git a/dojo/torii-config.toml b/dojo/torii-config.toml index 7d369a01..f362d6de 100644 --- a/dojo/torii-config.toml +++ b/dojo/torii-config.toml @@ -1,5 +1,5 @@ # The World address to index. -world_address = "0x055ab491f46e96bfdbefab82c7ff1101bf8fd10bdb4e47c01533bc2a2a1e9e9e" +world_address = "0x07220cd7725010ad17892773ffcca9347fcd2c899171a4df67b740196ec0a1d6" # Default RPC URL configuration rpc = "https://api.cartridge.gg/x/starknet/sepolia"