From 01f37fa8b4b1daa0e81c7609dfe8b958281449b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Sun, 22 Jun 2025 00:00:23 -0600 Subject: [PATCH 1/4] feat: update world and contract address for new sepolia deployment --- contract/dojo_sepolia.toml | 2 +- contract/manifest_sepolia.json | 109 +++++++++++++++++++++++++++++++-- contract/torii_config.toml | 2 +- 3 files changed, 107 insertions(+), 6 deletions(-) diff --git a/contract/dojo_sepolia.toml b/contract/dojo_sepolia.toml index a80ef98..c4701d9 100644 --- a/contract/dojo_sepolia.toml +++ b/contract/dojo_sepolia.toml @@ -2,7 +2,7 @@ name = "Golem Runner" description = "Golem Runner is a mobile endless runner game where players control elemental golems. Built using Dojo Engine and Cartridge Controller on Starknet." website = "https://github.com/AkatsukiLabs/GolemRunner" -seed = "golem_runner6" +seed = "golem_runner7" [namespace] default = "golem_runner" diff --git a/contract/manifest_sepolia.json b/contract/manifest_sepolia.json index f63e4eb..61a785f 100644 --- a/contract/manifest_sepolia.json +++ b/contract/manifest_sepolia.json @@ -1,8 +1,8 @@ { "world": { "class_hash": "0x7c9469d45a9cdbab775035afb48e1fa73fb35ab059fcb9dfb0a301aa973e783", - "address": "0x1fe4f3da25325886ab8c89826d0af42385e36f2cdb717441532e3220d179da4", - "seed": "golem_runner6", + "address": "0x7c677ef29a276a115468ee7f53094720de5da6d443e6f1a2b7f4a6afb6f86b2", + "seed": "golem_runner7", "name": "Golem Runner", "entrypoints": [ "uuid", @@ -1312,8 +1312,8 @@ }, "contracts": [ { - "address": "0x681ea222117a7e68124fdb1dbbdee016a560fd453b846fb54bef34be325882d", - "class_hash": "0x3341e5d0066d25ab19de417dd772c05593d88063f6084b81b03841d4802d909", + "address": "0x36a518498c1d7de4106b8904f0878e1e7b78c73614001fba22eba0adca80387", + "class_hash": "0x75e15e84fe204faeaa58f91e626f7e4d0a8ca897763f28e0d96ffc1b0a52c2", "abi": [ { "type": "impl", @@ -1405,6 +1405,42 @@ } ] }, + { + "type": "enum", + "name": "golem_runner::types::world::WorldType", + "variants": [ + { + "name": "Forest", + "type": "()" + }, + { + "name": "Volcano", + "type": "()" + }, + { + "name": "Glacier", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "golem_runner::types::golem::GolemType", + "variants": [ + { + "name": "Fire", + "type": "()" + }, + { + "name": "Ice", + "type": "()" + }, + { + "name": "Stone", + "type": "()" + } + ] + }, { "type": "interface", "name": "golem_runner::systems::game::IGame", @@ -1502,6 +1538,62 @@ } ], "state_mutability": "external" + }, + { + "type": "function", + "name": "create_mission", + "inputs": [ + { + "name": "target_coins", + "type": "core::integer::u64" + }, + { + "name": "required_world", + "type": "golem_runner::types::world::WorldType" + }, + { + "name": "required_golem", + "type": "golem_runner::types::golem::GolemType" + }, + { + "name": "description", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_mission", + "inputs": [ + { + "name": "mission_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "reward_current_mission", + "inputs": [ + { + "name": "mission_id", + "type": "core::integer::u256" + }, + { + "name": "coins_collected", + "type": "core::integer::u64" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, @@ -1636,6 +1728,9 @@ "update_golem_name", "unlock_golem_store", "unlock_world_store", + "create_mission", + "update_mission", + "reward_current_mission", "upgrade" ] } @@ -1648,6 +1743,12 @@ "tag": "golem_runner-Golem", "selector": "0x5a1af4923c31f36a9a9b5cd3f717dac8c55c1e6a26e92a0e4f28d30754166db" }, + { + "members": [], + "class_hash": "0x2d620c3d3bc76ab5016d9707bcc9ca995ee446492cb26fc41744600d04ecf0f", + "tag": "golem_runner-Mission", + "selector": "0x53894aba2c90ef9aeb7f37e5690c7f994547a79dcce91e9f2f098baa85587a" + }, { "members": [], "class_hash": "0x3f2287ca0736b645e3c9b3b4a09d1b15c1637debf3ccfbfd180aafe43f75d27", diff --git a/contract/torii_config.toml b/contract/torii_config.toml index e3156e9..4af7dcf 100644 --- a/contract/torii_config.toml +++ b/contract/torii_config.toml @@ -1,5 +1,5 @@ # The World address to index. -world_address = "0x01fe4f3da25325886ab8c89826d0af42385e36f2cdb717441532e3220d179da4" +world_address = "0x07c677ef29a276a115468ee7f53094720de5da6d443e6f1a2b7f4a6afb6f86b2" # Default RPC URL configuration rpc = "https://api.cartridge.gg/x/starknet/sepolia" From 0c85aa8243b177d7338920fa4693d52e7a347ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Sun, 22 Jun 2025 00:27:29 -0600 Subject: [PATCH 2/4] feat: update contract address and add mission management functions --- client/src/config/cartridgeConnector.tsx | 7 +- client/src/config/manifest_sepolia.json | 109 ++++- client/src/dojo/contracts.gen.ts | 558 ++++++++++++++++------- 3 files changed, 497 insertions(+), 177 deletions(-) diff --git a/client/src/config/cartridgeConnector.tsx b/client/src/config/cartridgeConnector.tsx index 2b58c71..de71861 100644 --- a/client/src/config/cartridgeConnector.tsx +++ b/client/src/config/cartridgeConnector.tsx @@ -6,7 +6,7 @@ import { constants } from "starknet"; const { VITE_PUBLIC_DEPLOY_TYPE } = import.meta.env; -const CONTRACT_ADDRESS_GAME = '0x681ea222117a7e68124fdb1dbbdee016a560fd453b846fb54bef34be325882d' +const CONTRACT_ADDRESS_GAME = '0x36a518498c1d7de4106b8904f0878e1e7b78c73614001fba22eba0adca80387' const policies: SessionPolicies = { contracts: { @@ -19,6 +19,9 @@ const policies: SessionPolicies = { { name: "update_golem_name", entrypoint: "update_golem_name" }, { name: "unlock_golem_store", entrypoint: "unlock_golem_store" }, { name: "unlock_world_store", entrypoint: "unlock_world_store" }, + { name: "create_mission", entrypoint: "create_mission" }, + { name: "update_mission", entrypoint: "update_mission" }, + { name: "reward_current_mission", entrypoint: "reward_current_mission" }, ], }, }, @@ -39,7 +42,7 @@ const options: ControllerOptions = { theme, colorMode, namespace: "golem_runner", - slot: "golem5", + slot: "golem6", }; const cartridgeConnector = new ControllerConnector( diff --git a/client/src/config/manifest_sepolia.json b/client/src/config/manifest_sepolia.json index f63e4eb..61a785f 100644 --- a/client/src/config/manifest_sepolia.json +++ b/client/src/config/manifest_sepolia.json @@ -1,8 +1,8 @@ { "world": { "class_hash": "0x7c9469d45a9cdbab775035afb48e1fa73fb35ab059fcb9dfb0a301aa973e783", - "address": "0x1fe4f3da25325886ab8c89826d0af42385e36f2cdb717441532e3220d179da4", - "seed": "golem_runner6", + "address": "0x7c677ef29a276a115468ee7f53094720de5da6d443e6f1a2b7f4a6afb6f86b2", + "seed": "golem_runner7", "name": "Golem Runner", "entrypoints": [ "uuid", @@ -1312,8 +1312,8 @@ }, "contracts": [ { - "address": "0x681ea222117a7e68124fdb1dbbdee016a560fd453b846fb54bef34be325882d", - "class_hash": "0x3341e5d0066d25ab19de417dd772c05593d88063f6084b81b03841d4802d909", + "address": "0x36a518498c1d7de4106b8904f0878e1e7b78c73614001fba22eba0adca80387", + "class_hash": "0x75e15e84fe204faeaa58f91e626f7e4d0a8ca897763f28e0d96ffc1b0a52c2", "abi": [ { "type": "impl", @@ -1405,6 +1405,42 @@ } ] }, + { + "type": "enum", + "name": "golem_runner::types::world::WorldType", + "variants": [ + { + "name": "Forest", + "type": "()" + }, + { + "name": "Volcano", + "type": "()" + }, + { + "name": "Glacier", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "golem_runner::types::golem::GolemType", + "variants": [ + { + "name": "Fire", + "type": "()" + }, + { + "name": "Ice", + "type": "()" + }, + { + "name": "Stone", + "type": "()" + } + ] + }, { "type": "interface", "name": "golem_runner::systems::game::IGame", @@ -1502,6 +1538,62 @@ } ], "state_mutability": "external" + }, + { + "type": "function", + "name": "create_mission", + "inputs": [ + { + "name": "target_coins", + "type": "core::integer::u64" + }, + { + "name": "required_world", + "type": "golem_runner::types::world::WorldType" + }, + { + "name": "required_golem", + "type": "golem_runner::types::golem::GolemType" + }, + { + "name": "description", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_mission", + "inputs": [ + { + "name": "mission_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "reward_current_mission", + "inputs": [ + { + "name": "mission_id", + "type": "core::integer::u256" + }, + { + "name": "coins_collected", + "type": "core::integer::u64" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, @@ -1636,6 +1728,9 @@ "update_golem_name", "unlock_golem_store", "unlock_world_store", + "create_mission", + "update_mission", + "reward_current_mission", "upgrade" ] } @@ -1648,6 +1743,12 @@ "tag": "golem_runner-Golem", "selector": "0x5a1af4923c31f36a9a9b5cd3f717dac8c55c1e6a26e92a0e4f28d30754166db" }, + { + "members": [], + "class_hash": "0x2d620c3d3bc76ab5016d9707bcc9ca995ee446492cb26fc41744600d04ecf0f", + "tag": "golem_runner-Mission", + "selector": "0x53894aba2c90ef9aeb7f37e5690c7f994547a79dcce91e9f2f098baa85587a" + }, { "members": [], "class_hash": "0x3f2287ca0736b645e3c9b3b4a09d1b15c1637debf3ccfbfd180aafe43f75d27", diff --git a/client/src/dojo/contracts.gen.ts b/client/src/dojo/contracts.gen.ts index 50cc685..fc86e84 100644 --- a/client/src/dojo/contracts.gen.ts +++ b/client/src/dojo/contracts.gen.ts @@ -1,173 +1,389 @@ -import { DojoProvider, DojoCall } from "@dojoengine/core"; -import { Account, AccountInterface } from "starknet"; - -export function setupWorld(provider: DojoProvider) { - - const build_game_rewardPlayer_calldata = (points: number, coinsCollected: number): DojoCall => { - return { - contractName: "game", - entrypoint: "reward_player", - calldata: [points, coinsCollected], - }; - }; - - const game_rewardPlayer = async (snAccount: Account | AccountInterface, points: number, coinsCollected: number) => { - try { - return await provider.execute( - snAccount as any, - build_game_rewardPlayer_calldata(points, coinsCollected), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_spawnPlayer_calldata = (): DojoCall => { - return { - contractName: "game", - entrypoint: "spawn_player", - calldata: [], - }; - }; - - const game_spawnPlayer = async (snAccount: Account | AccountInterface) => { - try { - return await provider.execute( - snAccount as any, - build_game_spawnPlayer_calldata(), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_unlockGolemStore_calldata = (golemId: number): DojoCall => { - return { - contractName: "game", - entrypoint: "unlock_golem_store", - calldata: [golemId], - }; - }; - - const game_unlockGolemStore = async (snAccount: Account | AccountInterface, golemId: number) => { - try { - return await provider.execute( - snAccount as any, - build_game_unlockGolemStore_calldata(golemId), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_unlockWorldStore_calldata = (worldId: number): DojoCall => { - return { - contractName: "game", - entrypoint: "unlock_world_store", - calldata: [worldId], - }; - }; - - const game_unlockWorldStore = async (snAccount: Account | AccountInterface, worldId: number) => { - try { - return await provider.execute( - snAccount as any, - build_game_unlockWorldStore_calldata(worldId), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_updateGolemName_calldata = (golemId: number, name: number): DojoCall => { - return { - contractName: "game", - entrypoint: "update_golem_name", - calldata: [golemId, name], - }; - }; - - const game_updateGolemName = async (snAccount: Account | AccountInterface, golemId: number, name: number) => { - try { - return await provider.execute( - snAccount as any, - build_game_updateGolemName_calldata(golemId, name), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_updatePlayerDailyStreak_calldata = (): DojoCall => { - return { - contractName: "game", - entrypoint: "update_player_daily_streak", - calldata: [], - }; - }; - - const game_updatePlayerDailyStreak = async (snAccount: Account | AccountInterface) => { - try { - return await provider.execute( - snAccount as any, - build_game_updatePlayerDailyStreak_calldata(), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - const build_game_updatePlayerRanking_calldata = (worldId: number, points: number): DojoCall => { - return { - contractName: "game", - entrypoint: "update_player_ranking", - calldata: [worldId, points], - }; - }; - - const game_updatePlayerRanking = async (snAccount: Account | AccountInterface, worldId: number, points: number) => { - try { - return await provider.execute( - snAccount as any, - build_game_updatePlayerRanking_calldata(worldId, points), - "golem_runner", - ); - } catch (error) { - console.error(error); - throw error; - } - }; - - - - return { - game: { - rewardPlayer: game_rewardPlayer, - buildRewardPlayerCalldata: build_game_rewardPlayer_calldata, - spawnPlayer: game_spawnPlayer, - buildSpawnPlayerCalldata: build_game_spawnPlayer_calldata, - unlockGolemStore: game_unlockGolemStore, - buildUnlockGolemStoreCalldata: build_game_unlockGolemStore_calldata, - unlockWorldStore: game_unlockWorldStore, - buildUnlockWorldStoreCalldata: build_game_unlockWorldStore_calldata, - updateGolemName: game_updateGolemName, - buildUpdateGolemNameCalldata: build_game_updateGolemName_calldata, - updatePlayerDailyStreak: game_updatePlayerDailyStreak, - buildUpdatePlayerDailyStreakCalldata: build_game_updatePlayerDailyStreak_calldata, - updatePlayerRanking: game_updatePlayerRanking, - buildUpdatePlayerRankingCalldata: build_game_updatePlayerRanking_calldata, +import type { SchemaType as ISchemaType } from "@dojoengine/sdk"; + +import { CairoCustomEnum } from 'starknet'; + +// Type definition for `golem_runner::models::golem::Golem` struct +export interface Golem { + id: number; + player_id: string; + name: number; + description: number; + price: number; + rarity: RarityEnum; + is_starter: boolean; + is_unlocked: boolean; +} + +// Type definition for `golem_runner::models::golem::GolemValue` struct +export interface GolemValue { + name: number; + description: number; + price: number; + rarity: RarityEnum; + is_starter: boolean; + is_unlocked: boolean; +} + +// Type definition for `golem_runner::models::mission::Mission` struct +export interface Mission { + id: number; + player_id: string; + target_coins: number; + required_world: WorldTypeEnum; + required_golem: GolemTypeEnum; + description: string; + status: MissionStatusEnum; + created_at: number; +} + +// Type definition for `golem_runner::models::mission::MissionValue` struct +export interface MissionValue { + target_coins: number; + required_world: WorldTypeEnum; + required_golem: GolemTypeEnum; + description: string; + status: MissionStatusEnum; + created_at: number; +} + +// Type definition for `golem_runner::models::player::Player` struct +export interface Player { + address: string; + coins: number; + total_points: number; + daily_streak: number; + last_active_day: number; + level: number; + experience: number; + creation_day: number; +} + +// Type definition for `golem_runner::models::player::PlayerValue` struct +export interface PlayerValue { + coins: number; + total_points: number; + daily_streak: number; + last_active_day: number; + level: number; + experience: number; + creation_day: number; +} + +// Type definition for `golem_runner::models::ranking::Ranking` struct +export interface Ranking { + world_id: number; + player: string; + points: number; +} + +// Type definition for `golem_runner::models::ranking::RankingValue` struct +export interface RankingValue { + points: number; +} + +// Type definition for `golem_runner::models::world::World` struct +export interface World { + id: number; + player_id: string; + name: number; + description: number; + price: number; + is_starter: boolean; + is_unlocked: boolean; +} + +// Type definition for `golem_runner::models::world::WorldValue` struct +export interface WorldValue { + name: number; + description: number; + price: number; + is_starter: boolean; + is_unlocked: boolean; +} + +// Type definition for `achievement::events::index::TrophyCreation` struct +export interface TrophyCreation { + id: number; + hidden: boolean; + index: number; + points: number; + start: number; + end: number; + group: number; + icon: number; + title: number; + description: string; + tasks: Array; + data: string; +} + +// Type definition for `achievement::events::index::TrophyCreationValue` struct +export interface TrophyCreationValue { + hidden: boolean; + index: number; + points: number; + start: number; + end: number; + group: number; + icon: number; + title: number; + description: string; + tasks: Array; + data: string; +} + +// Type definition for `achievement::events::index::TrophyProgression` struct +export interface TrophyProgression { + player_id: number; + task_id: number; + count: number; + time: number; +} + +// Type definition for `achievement::events::index::TrophyProgressionValue` struct +export interface TrophyProgressionValue { + count: number; + time: number; +} + +// Type definition for `achievement::types::index::Task` struct +export interface Task { + id: number; + total: number; + description: string; +} + +// Type definition for `golem_runner::types::golem::GolemType` enum +export type GolemType = { + Fire: string; + Ice: string; + Stone: string; +} +export type GolemTypeEnum = CairoCustomEnum; + +// Type definition for `golem_runner::types::mission_status::MissionStatus` enum +export type MissionStatus = { + Pending: string; + Completed: string; +} +export type MissionStatusEnum = CairoCustomEnum; + +// Type definition for `golem_runner::types::rarity::Rarity` enum +export type Rarity = { + Basic: string; + Common: string; + Uncommon: string; + Rare: string; + VeryRare: string; + Epic: string; + Unique: string; +} +export type RarityEnum = CairoCustomEnum; + +// Type definition for `golem_runner::types::world::WorldType` enum +export type WorldType = { + Forest: string; + Volcano: string; + Glacier: string; +} +export type WorldTypeEnum = CairoCustomEnum; + +export interface SchemaType extends ISchemaType { + golem_runner: { + Golem: Golem, + GolemValue: GolemValue, + Mission: Mission, + MissionValue: MissionValue, + Player: Player, + PlayerValue: PlayerValue, + Ranking: Ranking, + RankingValue: RankingValue, + World: World, + WorldValue: WorldValue, + }, + achievement: { + TrophyCreation: TrophyCreation, + TrophyCreationValue: TrophyCreationValue, + TrophyProgression: TrophyProgression, + TrophyProgressionValue: TrophyProgressionValue, + Task: Task, + }, +} +export const schema: SchemaType = { + golem_runner: { + Golem: { + id: 0, + player_id: "", + name: 0, + description: 0, + price: 0, + rarity: new CairoCustomEnum({ + Basic: "Basic", + Common: "Common", + Uncommon: "Uncommon", + Rare: "Rare", + VeryRare: "VeryRare", + Epic: "Epic", + Unique: "Unique", }), + is_starter: false, + is_unlocked: false, + }, + GolemValue: { + name: 0, + description: 0, + price: 0, + rarity: new CairoCustomEnum({ + Basic: "Basic", + Common: "Common", + Uncommon: "Uncommon", + Rare: "Rare", + VeryRare: "VeryRare", + Epic: "Epic", + Unique: "Unique", }), + is_starter: false, + is_unlocked: false, }, - }; + Mission: { + id: 0, + player_id: "", + target_coins: 0, + required_world: new CairoCustomEnum({ + Forest: "Forest", + Volcano: "Volcano", + Glacier: "Glacier", }), + required_golem: new CairoCustomEnum({ + Fire: "Fire", + Ice: "Ice", + Stone: "Stone", }), + description: "", + status: new CairoCustomEnum({ + Pending: "Pending", + Completed: "Completed", }), + created_at: 0, + }, + MissionValue: { + target_coins: 0, + required_world: new CairoCustomEnum({ + Forest: "Forest", + Volcano: "Volcano", + Glacier: "Glacier", }), + required_golem: new CairoCustomEnum({ + Fire: "Fire", + Ice: "Ice", + Stone: "Stone", }), + description: "", + status: new CairoCustomEnum({ + Pending: "Pending", + Completed: "Completed", }), + created_at: 0, + }, + Player: { + address: "", + coins: 0, + total_points: 0, + daily_streak: 0, + last_active_day: 0, + level: 0, + experience: 0, + creation_day: 0, + }, + PlayerValue: { + coins: 0, + total_points: 0, + daily_streak: 0, + last_active_day: 0, + level: 0, + experience: 0, + creation_day: 0, + }, + Ranking: { + world_id: 0, + player: "", + points: 0, + }, + RankingValue: { + points: 0, + }, + World: { + id: 0, + player_id: "", + name: 0, + description: 0, + price: 0, + is_starter: false, + is_unlocked: false, + }, + WorldValue: { + name: 0, + description: 0, + price: 0, + is_starter: false, + is_unlocked: false, + }, + }, + achievement: { + TrophyCreation: { + id: 0, + hidden: false, + index: 0, + points: 0, + start: 0, + end: 0, + group: 0, + icon: 0, + title: 0, + description: "", + tasks: [{ id: 0, total: 0, description: "", }], + data: "", + }, + TrophyCreationValue: { + hidden: false, + index: 0, + points: 0, + start: 0, + end: 0, + group: 0, + icon: 0, + title: 0, + description: "", + tasks: [{ id: 0, total: 0, description: "", }], + data: "", + }, + TrophyProgression: { + player_id: 0, + task_id: 0, + count: 0, + time: 0, + }, + TrophyProgressionValue: { + count: 0, + time: 0, + }, + Task: { + id: 0, + total: 0, + description: "", + }, + } +}; +export enum ModelsMapping { + Golem = 'golem_runner-Golem', + GolemValue = 'golem_runner-GolemValue', + Mission = 'golem_runner-Mission', + MissionValue = 'golem_runner-MissionValue', + Player = 'golem_runner-Player', + PlayerValue = 'golem_runner-PlayerValue', + Ranking = 'golem_runner-Ranking', + RankingValue = 'golem_runner-RankingValue', + World = 'golem_runner-World', + WorldValue = 'golem_runner-WorldValue', + GolemType = 'golem_runner-GolemType', + MissionStatus = 'golem_runner-MissionStatus', + Rarity = 'golem_runner-Rarity', + WorldType = 'golem_runner-WorldType', + TrophyCreation = 'achievement-TrophyCreation', + TrophyCreationValue = 'achievement-TrophyCreationValue', + TrophyProgression = 'achievement-TrophyProgression', + TrophyProgressionValue = 'achievement-TrophyProgressionValue', + Task = 'achievement-Task', } \ No newline at end of file From e8890f7b3c5dc14456f97366acaab4ec7119a498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Sun, 22 Jun 2025 00:38:47 -0600 Subject: [PATCH 3/4] fix: bindings and contracts files --- client/src/dojo/bindings.ts | 220 +++++++---- client/src/dojo/contracts.gen.ts | 627 ++++++++++++------------------- 2 files changed, 393 insertions(+), 454 deletions(-) diff --git a/client/src/dojo/bindings.ts b/client/src/dojo/bindings.ts index e19958f..fc86e84 100644 --- a/client/src/dojo/bindings.ts +++ b/client/src/dojo/bindings.ts @@ -6,8 +6,8 @@ import { CairoCustomEnum } from 'starknet'; export interface Golem { id: number; player_id: string; - name: string; - description: string; + name: number; + description: number; price: number; rarity: RarityEnum; is_starter: boolean; @@ -24,6 +24,28 @@ export interface GolemValue { is_unlocked: boolean; } +// Type definition for `golem_runner::models::mission::Mission` struct +export interface Mission { + id: number; + player_id: string; + target_coins: number; + required_world: WorldTypeEnum; + required_golem: GolemTypeEnum; + description: string; + status: MissionStatusEnum; + created_at: number; +} + +// Type definition for `golem_runner::models::mission::MissionValue` struct +export interface MissionValue { + target_coins: number; + required_world: WorldTypeEnum; + required_golem: GolemTypeEnum; + description: string; + status: MissionStatusEnum; + created_at: number; +} + // Type definition for `golem_runner::models::player::Player` struct export interface Player { address: string; @@ -40,9 +62,9 @@ export interface Player { export interface PlayerValue { coins: number; total_points: number; - level: number; daily_streak: number; last_active_day: number; + level: number; experience: number; creation_day: number; } @@ -63,8 +85,8 @@ export interface RankingValue { export interface World { id: number; player_id: string; - name: string; - description: string; + name: number; + description: number; price: number; is_starter: boolean; is_unlocked: boolean; @@ -131,6 +153,21 @@ export interface Task { description: string; } +// Type definition for `golem_runner::types::golem::GolemType` enum +export type GolemType = { + Fire: string; + Ice: string; + Stone: string; +} +export type GolemTypeEnum = CairoCustomEnum; + +// Type definition for `golem_runner::types::mission_status::MissionStatus` enum +export type MissionStatus = { + Pending: string; + Completed: string; +} +export type MissionStatusEnum = CairoCustomEnum; + // Type definition for `golem_runner::types::rarity::Rarity` enum export type Rarity = { Basic: string; @@ -143,10 +180,20 @@ export type Rarity = { } export type RarityEnum = CairoCustomEnum; +// Type definition for `golem_runner::types::world::WorldType` enum +export type WorldType = { + Forest: string; + Volcano: string; + Glacier: string; +} +export type WorldTypeEnum = CairoCustomEnum; + export interface SchemaType extends ISchemaType { golem_runner: { Golem: Golem, GolemValue: GolemValue, + Mission: Mission, + MissionValue: MissionValue, Player: Player, PlayerValue: PlayerValue, Ranking: Ranking, @@ -167,17 +214,17 @@ export const schema: SchemaType = { Golem: { id: 0, player_id: "", - name: "", - description: "", + name: 0, + description: 0, price: 0, rarity: new CairoCustomEnum({ - Basic: "Basic", - Common: "Common", - Uncommon: "Uncommon", - Rare: "Rare", - VeryRare: "VeryRare", - Epic: "Epic", - Unique: "Unique", }), + Basic: "Basic", + Common: "Common", + Uncommon: "Uncommon", + Rare: "Rare", + VeryRare: "VeryRare", + Epic: "Epic", + Unique: "Unique", }), is_starter: false, is_unlocked: false, }, @@ -186,16 +233,50 @@ export const schema: SchemaType = { description: 0, price: 0, rarity: new CairoCustomEnum({ - Basic: "Basic", - Common: "Common", - Uncommon: "Uncommon", - Rare: "Rare", - VeryRare: "VeryRare", - Epic: "Epic", - Unique: "Unique", }), + Basic: "Basic", + Common: "Common", + Uncommon: "Uncommon", + Rare: "Rare", + VeryRare: "VeryRare", + Epic: "Epic", + Unique: "Unique", }), is_starter: false, is_unlocked: false, }, + Mission: { + id: 0, + player_id: "", + target_coins: 0, + required_world: new CairoCustomEnum({ + Forest: "Forest", + Volcano: "Volcano", + Glacier: "Glacier", }), + required_golem: new CairoCustomEnum({ + Fire: "Fire", + Ice: "Ice", + Stone: "Stone", }), + description: "", + status: new CairoCustomEnum({ + Pending: "Pending", + Completed: "Completed", }), + created_at: 0, + }, + MissionValue: { + target_coins: 0, + required_world: new CairoCustomEnum({ + Forest: "Forest", + Volcano: "Volcano", + Glacier: "Glacier", }), + required_golem: new CairoCustomEnum({ + Fire: "Fire", + Ice: "Ice", + Stone: "Stone", }), + description: "", + status: new CairoCustomEnum({ + Pending: "Pending", + Completed: "Completed", }), + created_at: 0, + }, Player: { address: "", coins: 0, @@ -226,8 +307,8 @@ export const schema: SchemaType = { World: { id: 0, player_id: "", - name: "", - description: "", + name: 0, + description: 0, price: 0, is_starter: false, is_unlocked: false, @@ -240,61 +321,66 @@ export const schema: SchemaType = { is_unlocked: false, }, }, - achievement: { - TrophyCreation: { - id: 0, - hidden: false, - index: 0, - points: 0, - start: 0, - end: 0, - group: 0, - icon: 0, - title: 0, - description: "", - tasks: [{ id: 0, total: 0, description: "", }], - data: "", - }, - TrophyCreationValue: { - hidden: false, - index: 0, - points: 0, - start: 0, - end: 0, - group: 0, - icon: 0, - title: 0, - description: "", - tasks: [{ id: 0, total: 0, description: "", }], - data: "", - }, - TrophyProgression: { - player_id: 0, - task_id: 0, - count: 0, - time: 0, - }, - TrophyProgressionValue: { - count: 0, - time: 0, - }, - Task: { - id: 0, - total: 0, - description: "", - }, - } + achievement: { + TrophyCreation: { + id: 0, + hidden: false, + index: 0, + points: 0, + start: 0, + end: 0, + group: 0, + icon: 0, + title: 0, + description: "", + tasks: [{ id: 0, total: 0, description: "", }], + data: "", + }, + TrophyCreationValue: { + hidden: false, + index: 0, + points: 0, + start: 0, + end: 0, + group: 0, + icon: 0, + title: 0, + description: "", + tasks: [{ id: 0, total: 0, description: "", }], + data: "", + }, + TrophyProgression: { + player_id: 0, + task_id: 0, + count: 0, + time: 0, + }, + TrophyProgressionValue: { + count: 0, + time: 0, + }, + Task: { + id: 0, + total: 0, + description: "", + }, + } }; export enum ModelsMapping { Golem = 'golem_runner-Golem', GolemValue = 'golem_runner-GolemValue', + Mission = 'golem_runner-Mission', + MissionValue = 'golem_runner-MissionValue', Player = 'golem_runner-Player', PlayerValue = 'golem_runner-PlayerValue', Ranking = 'golem_runner-Ranking', RankingValue = 'golem_runner-RankingValue', World = 'golem_runner-World', WorldValue = 'golem_runner-WorldValue', + GolemType = 'golem_runner-GolemType', + MissionStatus = 'golem_runner-MissionStatus', Rarity = 'golem_runner-Rarity', + WorldType = 'golem_runner-WorldType', TrophyCreation = 'achievement-TrophyCreation', TrophyCreationValue = 'achievement-TrophyCreationValue', TrophyProgression = 'achievement-TrophyProgression', diff --git a/client/src/dojo/contracts.gen.ts b/client/src/dojo/contracts.gen.ts index fc86e84..b43e14f 100644 --- a/client/src/dojo/contracts.gen.ts +++ b/client/src/dojo/contracts.gen.ts @@ -1,389 +1,242 @@ -import type { SchemaType as ISchemaType } from "@dojoengine/sdk"; - -import { CairoCustomEnum } from 'starknet'; - -// Type definition for `golem_runner::models::golem::Golem` struct -export interface Golem { - id: number; - player_id: string; - name: number; - description: number; - price: number; - rarity: RarityEnum; - is_starter: boolean; - is_unlocked: boolean; -} - -// Type definition for `golem_runner::models::golem::GolemValue` struct -export interface GolemValue { - name: number; - description: number; - price: number; - rarity: RarityEnum; - is_starter: boolean; - is_unlocked: boolean; -} - -// Type definition for `golem_runner::models::mission::Mission` struct -export interface Mission { - id: number; - player_id: string; - target_coins: number; - required_world: WorldTypeEnum; - required_golem: GolemTypeEnum; - description: string; - status: MissionStatusEnum; - created_at: number; -} - -// Type definition for `golem_runner::models::mission::MissionValue` struct -export interface MissionValue { - target_coins: number; - required_world: WorldTypeEnum; - required_golem: GolemTypeEnum; - description: string; - status: MissionStatusEnum; - created_at: number; -} - -// Type definition for `golem_runner::models::player::Player` struct -export interface Player { - address: string; - coins: number; - total_points: number; - daily_streak: number; - last_active_day: number; - level: number; - experience: number; - creation_day: number; -} - -// Type definition for `golem_runner::models::player::PlayerValue` struct -export interface PlayerValue { - coins: number; - total_points: number; - daily_streak: number; - last_active_day: number; - level: number; - experience: number; - creation_day: number; -} - -// Type definition for `golem_runner::models::ranking::Ranking` struct -export interface Ranking { - world_id: number; - player: string; - points: number; -} - -// Type definition for `golem_runner::models::ranking::RankingValue` struct -export interface RankingValue { - points: number; -} - -// Type definition for `golem_runner::models::world::World` struct -export interface World { - id: number; - player_id: string; - name: number; - description: number; - price: number; - is_starter: boolean; - is_unlocked: boolean; -} - -// Type definition for `golem_runner::models::world::WorldValue` struct -export interface WorldValue { - name: number; - description: number; - price: number; - is_starter: boolean; - is_unlocked: boolean; -} - -// Type definition for `achievement::events::index::TrophyCreation` struct -export interface TrophyCreation { - id: number; - hidden: boolean; - index: number; - points: number; - start: number; - end: number; - group: number; - icon: number; - title: number; - description: string; - tasks: Array; - data: string; -} - -// Type definition for `achievement::events::index::TrophyCreationValue` struct -export interface TrophyCreationValue { - hidden: boolean; - index: number; - points: number; - start: number; - end: number; - group: number; - icon: number; - title: number; - description: string; - tasks: Array; - data: string; -} - -// Type definition for `achievement::events::index::TrophyProgression` struct -export interface TrophyProgression { - player_id: number; - task_id: number; - count: number; - time: number; -} - -// Type definition for `achievement::events::index::TrophyProgressionValue` struct -export interface TrophyProgressionValue { - count: number; - time: number; -} - -// Type definition for `achievement::types::index::Task` struct -export interface Task { - id: number; - total: number; - description: string; -} - -// Type definition for `golem_runner::types::golem::GolemType` enum -export type GolemType = { - Fire: string; - Ice: string; - Stone: string; -} -export type GolemTypeEnum = CairoCustomEnum; - -// Type definition for `golem_runner::types::mission_status::MissionStatus` enum -export type MissionStatus = { - Pending: string; - Completed: string; -} -export type MissionStatusEnum = CairoCustomEnum; - -// Type definition for `golem_runner::types::rarity::Rarity` enum -export type Rarity = { - Basic: string; - Common: string; - Uncommon: string; - Rare: string; - VeryRare: string; - Epic: string; - Unique: string; -} -export type RarityEnum = CairoCustomEnum; - -// Type definition for `golem_runner::types::world::WorldType` enum -export type WorldType = { - Forest: string; - Volcano: string; - Glacier: string; -} -export type WorldTypeEnum = CairoCustomEnum; - -export interface SchemaType extends ISchemaType { - golem_runner: { - Golem: Golem, - GolemValue: GolemValue, - Mission: Mission, - MissionValue: MissionValue, - Player: Player, - PlayerValue: PlayerValue, - Ranking: Ranking, - RankingValue: RankingValue, - World: World, - WorldValue: WorldValue, - }, - achievement: { - TrophyCreation: TrophyCreation, - TrophyCreationValue: TrophyCreationValue, - TrophyProgression: TrophyProgression, - TrophyProgressionValue: TrophyProgressionValue, - Task: Task, - }, -} -export const schema: SchemaType = { - golem_runner: { - Golem: { - id: 0, - player_id: "", - name: 0, - description: 0, - price: 0, - rarity: new CairoCustomEnum({ - Basic: "Basic", - Common: "Common", - Uncommon: "Uncommon", - Rare: "Rare", - VeryRare: "VeryRare", - Epic: "Epic", - Unique: "Unique", }), - is_starter: false, - is_unlocked: false, - }, - GolemValue: { - name: 0, - description: 0, - price: 0, - rarity: new CairoCustomEnum({ - Basic: "Basic", - Common: "Common", - Uncommon: "Uncommon", - Rare: "Rare", - VeryRare: "VeryRare", - Epic: "Epic", - Unique: "Unique", }), - is_starter: false, - is_unlocked: false, - }, - Mission: { - id: 0, - player_id: "", - target_coins: 0, - required_world: new CairoCustomEnum({ - Forest: "Forest", - Volcano: "Volcano", - Glacier: "Glacier", }), - required_golem: new CairoCustomEnum({ - Fire: "Fire", - Ice: "Ice", - Stone: "Stone", }), - description: "", - status: new CairoCustomEnum({ - Pending: "Pending", - Completed: "Completed", }), - created_at: 0, - }, - MissionValue: { - target_coins: 0, - required_world: new CairoCustomEnum({ - Forest: "Forest", - Volcano: "Volcano", - Glacier: "Glacier", }), - required_golem: new CairoCustomEnum({ - Fire: "Fire", - Ice: "Ice", - Stone: "Stone", }), - description: "", - status: new CairoCustomEnum({ - Pending: "Pending", - Completed: "Completed", }), - created_at: 0, - }, - Player: { - address: "", - coins: 0, - total_points: 0, - daily_streak: 0, - last_active_day: 0, - level: 0, - experience: 0, - creation_day: 0, - }, - PlayerValue: { - coins: 0, - total_points: 0, - daily_streak: 0, - last_active_day: 0, - level: 0, - experience: 0, - creation_day: 0, - }, - Ranking: { - world_id: 0, - player: "", - points: 0, - }, - RankingValue: { - points: 0, - }, - World: { - id: 0, - player_id: "", - name: 0, - description: 0, - price: 0, - is_starter: false, - is_unlocked: false, - }, - WorldValue: { - name: 0, - description: 0, - price: 0, - is_starter: false, - is_unlocked: false, - }, - }, - achievement: { - TrophyCreation: { - id: 0, - hidden: false, - index: 0, - points: 0, - start: 0, - end: 0, - group: 0, - icon: 0, - title: 0, - description: "", - tasks: [{ id: 0, total: 0, description: "", }], - data: "", - }, - TrophyCreationValue: { - hidden: false, - index: 0, - points: 0, - start: 0, - end: 0, - group: 0, - icon: 0, - title: 0, - description: "", - tasks: [{ id: 0, total: 0, description: "", }], - data: "", - }, - TrophyProgression: { - player_id: 0, - task_id: 0, - count: 0, - time: 0, - }, - TrophyProgressionValue: { - count: 0, - time: 0, - }, - Task: { - id: 0, - total: 0, - description: "", - }, +import { DojoProvider, DojoCall } from "@dojoengine/core"; +import { Account, AccountInterface, CairoCustomEnum, ByteArray } from "starknet"; + +export function setupWorld(provider: DojoProvider) { + + const build_game_createMission_calldata = (targetCoins: number, requiredWorld: CairoCustomEnum, requiredGolem: CairoCustomEnum, description: ByteArray): DojoCall => { + return { + contractName: "game", + entrypoint: "create_mission", + calldata: [targetCoins, requiredWorld, requiredGolem, description], + }; + }; + + const game_createMission = async (snAccount: Account | AccountInterface, targetCoins: number, requiredWorld: CairoCustomEnum, requiredGolem: CairoCustomEnum, description: ByteArray) => { + try { + return await provider.execute( + snAccount as any, + build_game_createMission_calldata(targetCoins, requiredWorld, requiredGolem, description), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; } -}; -export enum ModelsMapping { - Golem = 'golem_runner-Golem', - GolemValue = 'golem_runner-GolemValue', - Mission = 'golem_runner-Mission', - MissionValue = 'golem_runner-MissionValue', - Player = 'golem_runner-Player', - PlayerValue = 'golem_runner-PlayerValue', - Ranking = 'golem_runner-Ranking', - RankingValue = 'golem_runner-RankingValue', - World = 'golem_runner-World', - WorldValue = 'golem_runner-WorldValue', - GolemType = 'golem_runner-GolemType', - MissionStatus = 'golem_runner-MissionStatus', - Rarity = 'golem_runner-Rarity', - WorldType = 'golem_runner-WorldType', - TrophyCreation = 'achievement-TrophyCreation', - TrophyCreationValue = 'achievement-TrophyCreationValue', - TrophyProgression = 'achievement-TrophyProgression', - TrophyProgressionValue = 'achievement-TrophyProgressionValue', - Task = 'achievement-Task', + }; + + const build_game_rewardCurrentMission_calldata = (missionId: number, coinsCollected: number): DojoCall => { + return { + contractName: "game", + entrypoint: "reward_current_mission", + calldata: [missionId, coinsCollected], + }; + }; + + const game_rewardCurrentMission = async (snAccount: Account | AccountInterface, missionId: number, coinsCollected: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_rewardCurrentMission_calldata(missionId, coinsCollected), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_rewardPlayer_calldata = (points: number, coinsCollected: number): DojoCall => { + return { + contractName: "game", + entrypoint: "reward_player", + calldata: [points, coinsCollected], + }; + }; + + const game_rewardPlayer = async (snAccount: Account | AccountInterface, points: number, coinsCollected: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_rewardPlayer_calldata(points, coinsCollected), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_spawnPlayer_calldata = (): DojoCall => { + return { + contractName: "game", + entrypoint: "spawn_player", + calldata: [], + }; + }; + + const game_spawnPlayer = async (snAccount: Account | AccountInterface) => { + try { + return await provider.execute( + snAccount as any, + build_game_spawnPlayer_calldata(), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_unlockGolemStore_calldata = (golemId: number): DojoCall => { + return { + contractName: "game", + entrypoint: "unlock_golem_store", + calldata: [golemId], + }; + }; + + const game_unlockGolemStore = async (snAccount: Account | AccountInterface, golemId: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_unlockGolemStore_calldata(golemId), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_unlockWorldStore_calldata = (worldId: number): DojoCall => { + return { + contractName: "game", + entrypoint: "unlock_world_store", + calldata: [worldId], + }; + }; + + const game_unlockWorldStore = async (snAccount: Account | AccountInterface, worldId: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_unlockWorldStore_calldata(worldId), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_updateGolemName_calldata = (golemId: number, name: number): DojoCall => { + return { + contractName: "game", + entrypoint: "update_golem_name", + calldata: [golemId, name], + }; + }; + + const game_updateGolemName = async (snAccount: Account | AccountInterface, golemId: number, name: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_updateGolemName_calldata(golemId, name), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_updateMission_calldata = (missionId: number): DojoCall => { + return { + contractName: "game", + entrypoint: "update_mission", + calldata: [missionId], + }; + }; + + const game_updateMission = async (snAccount: Account | AccountInterface, missionId: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_updateMission_calldata(missionId), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_updatePlayerDailyStreak_calldata = (): DojoCall => { + return { + contractName: "game", + entrypoint: "update_player_daily_streak", + calldata: [], + }; + }; + + const game_updatePlayerDailyStreak = async (snAccount: Account | AccountInterface) => { + try { + return await provider.execute( + snAccount as any, + build_game_updatePlayerDailyStreak_calldata(), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + const build_game_updatePlayerRanking_calldata = (worldId: number, points: number): DojoCall => { + return { + contractName: "game", + entrypoint: "update_player_ranking", + calldata: [worldId, points], + }; + }; + + const game_updatePlayerRanking = async (snAccount: Account | AccountInterface, worldId: number, points: number) => { + try { + return await provider.execute( + snAccount as any, + build_game_updatePlayerRanking_calldata(worldId, points), + "golem_runner", + ); + } catch (error) { + console.error(error); + throw error; + } + }; + + + + return { + game: { + createMission: game_createMission, + buildCreateMissionCalldata: build_game_createMission_calldata, + rewardCurrentMission: game_rewardCurrentMission, + buildRewardCurrentMissionCalldata: build_game_rewardCurrentMission_calldata, + rewardPlayer: game_rewardPlayer, + buildRewardPlayerCalldata: build_game_rewardPlayer_calldata, + spawnPlayer: game_spawnPlayer, + buildSpawnPlayerCalldata: build_game_spawnPlayer_calldata, + unlockGolemStore: game_unlockGolemStore, + buildUnlockGolemStoreCalldata: build_game_unlockGolemStore_calldata, + unlockWorldStore: game_unlockWorldStore, + buildUnlockWorldStoreCalldata: build_game_unlockWorldStore_calldata, + updateGolemName: game_updateGolemName, + buildUpdateGolemNameCalldata: build_game_updateGolemName_calldata, + updateMission: game_updateMission, + buildUpdateMissionCalldata: build_game_updateMission_calldata, + updatePlayerDailyStreak: game_updatePlayerDailyStreak, + buildUpdatePlayerDailyStreakCalldata: build_game_updatePlayerDailyStreak_calldata, + updatePlayerRanking: game_updatePlayerRanking, + buildUpdatePlayerRankingCalldata: build_game_updatePlayerRanking_calldata, + }, + }; } \ No newline at end of file From c3fac70480106008f1bc942cb613a71ddc781137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Araya=20Jim=C3=A9nez?= Date: Sun, 22 Jun 2025 00:42:25 -0600 Subject: [PATCH 4/4] fix: bindings datatypes --- client/src/dojo/bindings.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/client/src/dojo/bindings.ts b/client/src/dojo/bindings.ts index fc86e84..af33192 100644 --- a/client/src/dojo/bindings.ts +++ b/client/src/dojo/bindings.ts @@ -6,8 +6,8 @@ import { CairoCustomEnum } from 'starknet'; export interface Golem { id: number; player_id: string; - name: number; - description: number; + name: string; + description: string; price: number; rarity: RarityEnum; is_starter: boolean; @@ -16,8 +16,8 @@ export interface Golem { // Type definition for `golem_runner::models::golem::GolemValue` struct export interface GolemValue { - name: number; - description: number; + name: string; + description: string; price: number; rarity: RarityEnum; is_starter: boolean; @@ -85,8 +85,8 @@ export interface RankingValue { export interface World { id: number; player_id: string; - name: number; - description: number; + name: string; + description: string; price: number; is_starter: boolean; is_unlocked: boolean; @@ -94,8 +94,8 @@ export interface World { // Type definition for `golem_runner::models::world::WorldValue` struct export interface WorldValue { - name: number; - description: number; + name: string; + description: string; price: number; is_starter: boolean; is_unlocked: boolean; @@ -214,8 +214,8 @@ export const schema: SchemaType = { Golem: { id: 0, player_id: "", - name: 0, - description: 0, + name: "", + description: "", price: 0, rarity: new CairoCustomEnum({ Basic: "Basic", @@ -229,8 +229,8 @@ export const schema: SchemaType = { is_unlocked: false, }, GolemValue: { - name: 0, - description: 0, + name: "", + description: "", price: 0, rarity: new CairoCustomEnum({ Basic: "Basic", @@ -307,15 +307,15 @@ export const schema: SchemaType = { World: { id: 0, player_id: "", - name: 0, - description: 0, + name: "", + description: "", price: 0, is_starter: false, is_unlocked: false, }, WorldValue: { - name: 0, - description: 0, + name: "", + description: "", price: 0, is_starter: false, is_unlocked: false,