From 6ff76068b24cd2cd7ada52e59c4e48c977132d46 Mon Sep 17 00:00:00 2001 From: Tony Stark Date: Mon, 24 Feb 2025 11:57:02 -0700 Subject: [PATCH 1/3] feat: changed namespace --- client/src/App.tsx | 4 +- client/src/lib/config.ts | 2 +- contracts/dojo_dev.toml | 10 ++--- contracts/dojo_sepolia.toml | 14 +++---- contracts/dojo_slot.toml | 10 ++--- contracts/manifest_dev.json | 30 +++++++------- contracts/manifest_sepolia.json | 72 ++++++++++++++++----------------- contracts/src/constants.cairo | 2 +- contracts/torii_dev.toml | 6 +-- 9 files changed, 75 insertions(+), 75 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 585a3612..aa59a298 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -20,8 +20,8 @@ import Checks from "./Checks"; const options = { theme: "realm-of-ra", policies: CONFIG.POLICIES, - namespace: "mancala_fire", - slot: "mancala-fire", + namespace: "mancala_wind", + slot: "mancala-wind", rpc: CONFIG.SLOT_RPC_URL, chains: [ { rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia" }, diff --git a/client/src/lib/config.ts b/client/src/lib/config.ts index 9545178c..800e4c96 100644 --- a/client/src/lib/config.ts +++ b/client/src/lib/config.ts @@ -26,7 +26,7 @@ const CONFIG = { : import.meta.env.VITE_SEPOLIA_MASTER_PRIVATE_KEY, MANCALA_ADDRESS, PROFILE_ADDRESS, - NAMESPACE: "mancala_fire", + NAMESPACE: "mancala_wind", CONTRACT_NAME: "Mancala", POLICIES: [ { diff --git a/contracts/dojo_dev.toml b/contracts/dojo_dev.toml index 31cabfc0..5c736778 100644 --- a/contracts/dojo_dev.toml +++ b/contracts/dojo_dev.toml @@ -13,12 +13,12 @@ github = "https://github.com/realm-of-ra/mancala" telegram = "https://t.me/dojoengine" [namespace] -default = "mancala_fire" +default = "mancala_wind" [writers] -"mancala_fire" = ["mancala_fire-Mancala", "mancala_fire-PlayerProfile"] -"mancala_fire-TrophyCreation" = ["mancala_fire-Mancala"] -"mancala_fire-TrophyProgression" = ["mancala_fire-Mancala"] +"mancala_wind" = ["mancala_wind-Mancala", "mancala_wind-PlayerProfile"] +"mancala_wind-TrophyCreation" = ["mancala_wind-Mancala"] +"mancala_wind-TrophyProgression" = ["mancala_wind-Mancala"] [env] rpc_url = "http://localhost:5050" @@ -31,7 +31,7 @@ ipfs_config.username = "2EBrzr7ZASQZKH32sl2xWauXPSA" ipfs_config.password = "12290b883db9138a8ae3363b6739d220" [init_call_args] -"mancala_fire-Mancala" = [ +"mancala_wind-Mancala" = [ "0x6daf2a924fab727ae5409f0743de4869850f988b6f8545268016ad1107fd2cd", # TOKEN_PASS_ADDRESS "0x07c4d03b35e224ac19247c429a203c36ca40653e12d28e696d2674ee61a60fa3", # GATEKEEPER_ADDRESS ] diff --git a/contracts/dojo_sepolia.toml b/contracts/dojo_sepolia.toml index 0d29f0d4..79e58da3 100644 --- a/contracts/dojo_sepolia.toml +++ b/contracts/dojo_sepolia.toml @@ -4,7 +4,7 @@ description = "Mancala is a fully on-chain PvP strategy boardgame built on Dojo. cover_uri = "file://assets/cover.png" icon_uri = "file://assets/icon.png" website = "https://github.com/realm-of-ra/mancala" -seed = "mancala-fire" +seed = "mancala-wind" [world.socials] x = "https://x.com/realm_of_ra" @@ -13,25 +13,25 @@ github = "https://github.com/realm-of-ra/mancala" telegram = "https://t.me/dojoengine" [namespace] -default = "mancala_fire" +default = "mancala_wind" [writers] -"mancala_fire" = ["mancala_fire-Mancala", "mancala_fire-PlayerProfile"] -"mancala_fire-TrophyCreation" = ["mancala_fire-Mancala"] -"mancala_fire-TrophyProgression" = ["mancala_fire-Mancala"] +"mancala_wind" = ["mancala_wind-Mancala", "mancala_wind-PlayerProfile"] +"mancala_wind-TrophyCreation" = ["mancala_wind-Mancala"] +"mancala_wind-TrophyProgression" = ["mancala_wind-Mancala"] [env] rpc_url = "https://api.cartridge.gg/x/starknet/sepolia" # Default account for katana with seed = 0 account_address = "0x02A54eFf65D55a2E7D2fC7E23eF0F0e6030dB0313b16c8F0eaD0b4a83807f6d6" private_key = "0x0396533b7a1182ef03da483eca82e9dd2b17bee9c7fec07ac6cbbeb8bfd573cb" -world_address = "0xce27bfce81edb0d913ee4956e52d7000ac48a1dccf9dc5b8140653dd2257a9" # Uncomment and update this line with your world address. +world_address = "0x07ccd70cdd217d66a7b6d2bf0a4ac6aecb9243996c2e55d21c8626f177860028" # Uncomment and update this line with your world address. ipfs_config.url = "https://ipfs.infura.io:5001" ipfs_config.username = "2EBrzr7ZASQZKH32sl2xWauXPSA" ipfs_config.password = "12290b883db9138a8ae3363b6739d220" [init_call_args] -"mancala_fire-Mancala" = [ +"mancala_wind-Mancala" = [ "0x07f413bd3ce6d349dd9efcd208894b9cd7b646979834ed771ffd62d160e25835", # TOKEN_PASS_ADDRESS "0x07837a565c98505A88338Ceb8245494af97C6caC2d0A23D9B08db5C052d7afA9", # GATEKEEPER_ADDRESS ] diff --git a/contracts/dojo_slot.toml b/contracts/dojo_slot.toml index 2dfa8784..db390a92 100644 --- a/contracts/dojo_slot.toml +++ b/contracts/dojo_slot.toml @@ -13,12 +13,12 @@ github = "https://github.com/realm-of-ra/mancala" telegram = "https://t.me/dojoengine" [namespace] -default = "mancala_fire" +default = "mancala_wind" [writers] -"mancala_fire" = ["mancala_fire-Mancala", "mancala_fire-PlayerProfile"] -"mancala_fire-TrophyCreation" = ["mancala_fire-Mancala"] -"mancala_fire-TrophyProgression" = ["mancala_fire-Mancala"] +"mancala_wind" = ["mancala_wind-Mancala", "mancala_wind-PlayerProfile"] +"mancala_wind-TrophyCreation" = ["mancala_wind-Mancala"] +"mancala_wind-TrophyProgression" = ["mancala_wind-Mancala"] [env] rpc_url = "https://api.cartridge.gg/x/mancala-alpha-v0-2-0/katana" @@ -31,4 +31,4 @@ ipfs_config.username = "2EBrzr7ZASQZKH32sl2xWauXPSA" ipfs_config.password = "12290b883db9138a8ae3363b6739d220" raw = true -historical = ["mancala_fire-TrophyProgression"] +historical = ["mancala_wind-TrophyProgression"] diff --git a/contracts/manifest_dev.json b/contracts/manifest_dev.json index 7dccccc6..38371e76 100644 --- a/contracts/manifest_dev.json +++ b/contracts/manifest_dev.json @@ -1673,7 +1673,7 @@ "0x6daf2a924fab727ae5409f0743de4869850f988b6f8545268016ad1107fd2cd", "0x07c4d03b35e224ac19247c429a203c36ca40653e12d28e696d2674ee61a60fa3" ], - "tag": "mancala_fire-Mancala", + "tag": "mancala_wind-Mancala", "selector": "0x13d960812a770ffd55061d9f9a413902a84fedfaa25f35b65ff537a8ee0a43c", "systems": [ "new_game", @@ -1910,7 +1910,7 @@ } ], "init_calldata": [], - "tag": "mancala_fire-PlayerProfile", + "tag": "mancala_wind-PlayerProfile", "selector": "0x5e371f1574af7946c0b6bbf887e412079bf3a6d9d446a588af48b17e3af19fd", "systems": ["upgrade"] } @@ -1919,43 +1919,43 @@ { "members": [], "class_hash": "0x39d434cc48c89f159e80e7a733ec593e1ad5e3bfa0a6c8e0ebe01c9ebad0fd5", - "tag": "mancala_fire-GameCounter", + "tag": "mancala_wind-GameCounter", "selector": "0x15a7935680f6203eb4693133afa0896b29f2e7c7e8958c72f64afd53187703" }, { "members": [], "class_hash": "0xdb4d28863ca84e283fd7b920277da2bf7b56e6792e2ca9968f02079965604a", - "tag": "mancala_fire-MancalaBoard", + "tag": "mancala_wind-MancalaBoard", "selector": "0x349ef6e9fd5dfbe85d156d1402d7f637086c2b227b15b813862e995e8b3287d" }, { "members": [], "class_hash": "0x17ddda187cf4cba8dd6611e905ee16fa14727991a723b1aed5b514dabed287c", - "tag": "mancala_fire-Pit", + "tag": "mancala_wind-Pit", "selector": "0x2c6935a765e8e05d7549ced89299cc249b37639129ea8e24d3d6ef75a496642" }, { "members": [], "class_hash": "0x1ddd10a6c17739d88d338693c5bfe20c1c80d76c97c9f1b6da5d2183573305", - "tag": "mancala_fire-Player", + "tag": "mancala_wind-Player", "selector": "0x19715eb8a877900585d4bdf0d85015d0cd71d446e6e8e98a9e39606c29e2f00" }, { "members": [], "class_hash": "0x6615b3f6b9338efd6e41fd19384a5c0766f9845112b4f3c9c32e1bb40d3af76", - "tag": "mancala_fire-Profile", + "tag": "mancala_wind-Profile", "selector": "0x5865abc13b2482691123fcd738862329228ee87d5d24eab167454b0d3ea706f" }, { "members": [], "class_hash": "0x57ccb5b2b68104683c3f66c08776b1bcf4c2f79a09b61efd045d2e84ca734ac", - "tag": "mancala_fire-Seed", + "tag": "mancala_wind-Seed", "selector": "0x5ba7bf14da0b8de368aaa7802b7e70b33a07a0f2defed9163c76c6c0b760f75" }, { "members": [], "class_hash": "0x3efdc22892bbbb9756ecc37fc9fd2f3a7e00f35deaad873d005e474fd30e942", - "tag": "mancala_fire-Settings", + "tag": "mancala_wind-Settings", "selector": "0x237ee0c12debb6dbc9de151742ca9203ca657e1a99a8f83ab4dc53d3fa8b275" } ], @@ -1963,37 +1963,37 @@ { "members": [], "class_hash": "0x4ffd5921ec24f70cb0068582335940c4a7c0c0c6e0f71b2105e7a5f9a0deb35", - "tag": "mancala_fire-Capture", + "tag": "mancala_wind-Capture", "selector": "0x55308ae1b9f4e3ffb654595e1342e0057438abc7c1e20ef6a36a56bc6907ced" }, { "members": [], "class_hash": "0x4100bbf73eba04fbc06379b8bf9cf5c207b81611df9e66ec794b95848a0fb93", - "tag": "mancala_fire-EndTurn", + "tag": "mancala_wind-EndTurn", "selector": "0x1bdf508f9f97fc4b981134bd03baf0f7cb9cf67549ba11a2c6266de9fde8ced" }, { "members": [], "class_hash": "0x746c4bda40c5d410f56296ae6623c13f9fa8b8b4ff36b5243e46c6c914b2f4f", - "tag": "mancala_fire-PlayerExtraTurn", + "tag": "mancala_wind-PlayerExtraTurn", "selector": "0x75792e50fbd3057b5fb11888e89620f11dbd909f94bd810742172de249a9378" }, { "members": [], "class_hash": "0x677e435979661e9e26aefb7cf8734a5019e825082019075fe5c16aef1c4be62", - "tag": "mancala_fire-PlayerMove", + "tag": "mancala_wind-PlayerMove", "selector": "0x764c7cb14a16d35371fddc1a1e131324b056fbfc1d7508400959d365fea424c" }, { "members": [], "class_hash": "0x19a5c06b3a8417ff3f9883be3acb0e33c835795bd81fb87a5a47e6ed7d2d3af", - "tag": "mancala_fire-TrophyCreation", + "tag": "mancala_wind-TrophyCreation", "selector": "0xede8b7309f7446faf452591c6a9573592c27400e9576320fc742b5c84508aa" }, { "members": [], "class_hash": "0x1922d2cd8b63eccf66321673234a52126cd9f0ab1bf6298c5abee6ee80c8990", - "tag": "mancala_fire-TrophyProgression", + "tag": "mancala_wind-TrophyProgression", "selector": "0x41e722a3c90f5f4adb31c0929d63ecf37fc28d99231851603178226074b891f" } ] diff --git a/contracts/manifest_sepolia.json b/contracts/manifest_sepolia.json index 6d51132f..24839b89 100644 --- a/contracts/manifest_sepolia.json +++ b/contracts/manifest_sepolia.json @@ -1,8 +1,8 @@ { "world": { "class_hash": "0x4b767fda48530353c2e44e4b9433f4d75c6c9974aaff43ecc00de9455eb71b8", - "address": "0xce27bfce81edb0d913ee4956e52d7000ac48a1dccf9dc5b8140653dd2257a9", - "seed": "mancala-fire", + "address": "0x7ccd70cdd217d66a7b6d2bf0a4ac6aecb9243996c2e55d21c8626f177860028", + "seed": "mancala-wind", "name": "Mancala", "entrypoints": [ "uuid", @@ -1252,8 +1252,8 @@ }, "contracts": [ { - "address": "0x7a72d73fda2ba047378588bdd35a5ae7e9fa13fcd796bfda5c237ed43031385", - "class_hash": "0x6fe74f47d48dac42c8a27edc8dda63157a4ea60c54a0841657f10ae612fd7cd", + "address": "0x5cfb844793f3aefa264ab40ee604cc6a8474959509f72f2836b69bdc18a9bd4", + "class_hash": "0x26bd58d8f03c405c7b247d8cf06a8574f79eb3f414f5801d239ff5aa5b677b8", "abi": [ { "type": "impl", @@ -1673,8 +1673,8 @@ "0x07f413bd3ce6d349dd9efcd208894b9cd7b646979834ed771ffd62d160e25835", "0x07837a565c98505A88338Ceb8245494af97C6caC2d0A23D9B08db5C052d7afA9" ], - "tag": "mancala_fire-Mancala", - "selector": "0x64759b7238bc58d9bd7071ae2fa5986ba136cb89c63cf19852c1ee8b4569e70", + "tag": "mancala_wind-Mancala", + "selector": "0x36ed0785c52824ca6d126112b5bbfd85b8788819315bed3c215e2ed840346de", "systems": [ "new_game", "join_game", @@ -1691,8 +1691,8 @@ ] }, { - "address": "0x25c143777d1cb2796dd58a135999b611d52bea4459c401e9247e957497a848c", - "class_hash": "0x5c1f32929f9505ddeaa3a50b3428fdcb92d25ded254156ee8456ba4efdf5140", + "address": "0xb63f7dde70a5a949b09cc699a5fd4ab5aa1159a64c67bf0e3ff64f897ae33f", + "class_hash": "0x37b5875b9e10422dce5a8f58dc0e30d0512ea2d8a27d236b0ec42a2212a505e", "abi": [ { "type": "impl", @@ -1910,8 +1910,8 @@ } ], "init_calldata": [], - "tag": "mancala_fire-PlayerProfile", - "selector": "0x2871895c46899885a6fb29b9c74e92ab6537136ff88275198db7166021d86f5", + "tag": "mancala_wind-PlayerProfile", + "selector": "0x67c7daeb586934a00401376726458d32c3f7d67bc8b9a9548eaa492f6f3f4a6", "systems": [ "upgrade" ] @@ -1921,82 +1921,82 @@ { "members": [], "class_hash": "0x39d434cc48c89f159e80e7a733ec593e1ad5e3bfa0a6c8e0ebe01c9ebad0fd5", - "tag": "mancala_fire-GameCounter", - "selector": "0xa062d2d8508fa8524c005335c7bf7f885eaf3f29f759600a9c0c1af3c6bbb6" + "tag": "mancala_wind-GameCounter", + "selector": "0x9321213a7e6408cbe414b7477611fbec6b733c3fe6436cb96a9ccc74b714a8" }, { "members": [], "class_hash": "0xdb4d28863ca84e283fd7b920277da2bf7b56e6792e2ca9968f02079965604a", - "tag": "mancala_fire-MancalaBoard", - "selector": "0x51f6df0c2fdeff6ca5b28d4d42ebd90603d9f96920ccc85633a22438938f9fe" + "tag": "mancala_wind-MancalaBoard", + "selector": "0x65d945fe25c568832f2f14cb70e810f9426096c1fc70e973302415ba8314f0c" }, { "members": [], "class_hash": "0x17ddda187cf4cba8dd6611e905ee16fa14727991a723b1aed5b514dabed287c", - "tag": "mancala_fire-Pit", - "selector": "0x74214d9654da302c8c0fc1eae80e0b0a3ce105d3fdcdc5d5117e576fbd41405" + "tag": "mancala_wind-Pit", + "selector": "0x6762d7f2623d5d120faa952d756828227f24a1d3a97913ce4376e4f5688d4ab" }, { "members": [], "class_hash": "0x1ddd10a6c17739d88d338693c5bfe20c1c80d76c97c9f1b6da5d2183573305", - "tag": "mancala_fire-Player", - "selector": "0x5d8d6db9b9225bf9a53e309573fa4a9b4ebd47008c27d7a66710ace0f676178" + "tag": "mancala_wind-Player", + "selector": "0x259f6ba1da4be5c908bfaff3955169e6d9df92ba5f3ab2dcd8528ebf35c3ea9" }, { "members": [], "class_hash": "0x6615b3f6b9338efd6e41fd19384a5c0766f9845112b4f3c9c32e1bb40d3af76", - "tag": "mancala_fire-Profile", - "selector": "0x786fb8c7475e92f9e68e3592dbd63c004095d9bbadbb7ca98a09afa03c96bd4" + "tag": "mancala_wind-Profile", + "selector": "0xc444d9057091d169c53709de8a44ca1445f9ed199b6340762ab175212c74a9" }, { "members": [], "class_hash": "0x57ccb5b2b68104683c3f66c08776b1bcf4c2f79a09b61efd045d2e84ca734ac", - "tag": "mancala_fire-Seed", - "selector": "0x222112f56a10459d79f5bb4c9678bf6a2ec798e56ef843fb7d1a9b3f5b83786" + "tag": "mancala_wind-Seed", + "selector": "0x597690ba2f460e7f5da8a750869825a8f184e0498a22dd3726873b588da3f4e" }, { "members": [], "class_hash": "0x3efdc22892bbbb9756ecc37fc9fd2f3a7e00f35deaad873d005e474fd30e942", - "tag": "mancala_fire-Settings", - "selector": "0x5516ec0ab99582fbcf4f442654057a7729d317f6f529fd359a46d4469d01df" + "tag": "mancala_wind-Settings", + "selector": "0x64ca608a432fecb15ccfc76cba6072fb371334ee6599c36f5d70ef27c92e58a" } ], "events": [ { "members": [], "class_hash": "0x4ffd5921ec24f70cb0068582335940c4a7c0c0c6e0f71b2105e7a5f9a0deb35", - "tag": "mancala_fire-Capture", - "selector": "0x9336ce0e5ffa774a5c3a6a13f863f1090892d90782a768b74e947aab047ee6" + "tag": "mancala_wind-Capture", + "selector": "0x7194eb93af95c9b68d88848856a663dd58a3ad6a2579063c7b582f2c31bdac3" }, { "members": [], "class_hash": "0x4100bbf73eba04fbc06379b8bf9cf5c207b81611df9e66ec794b95848a0fb93", - "tag": "mancala_fire-EndTurn", - "selector": "0x26478f5ce04154e73ec5bf1cad2d9591250bfbd077918822e9a0aabcd83b9b7" + "tag": "mancala_wind-EndTurn", + "selector": "0x58a0cb9b11189be1c10e2e69bba3a79c57ed333014707dd12be8620366c5238" }, { "members": [], "class_hash": "0x746c4bda40c5d410f56296ae6623c13f9fa8b8b4ff36b5243e46c6c914b2f4f", - "tag": "mancala_fire-PlayerExtraTurn", - "selector": "0x127a81caf31981f0bbd6a60446826c917b0d2e6dd31ba13271350ecc720de95" + "tag": "mancala_wind-PlayerExtraTurn", + "selector": "0x23620249e0a443f57ebf65607e5a61de208508ea26f2a1d7b5981082714c007" }, { "members": [], "class_hash": "0x677e435979661e9e26aefb7cf8734a5019e825082019075fe5c16aef1c4be62", - "tag": "mancala_fire-PlayerMove", - "selector": "0x1d495215e527a188dd1e5988719100c06688a893cf84e4278daa9c20afe5efa" + "tag": "mancala_wind-PlayerMove", + "selector": "0x6608718a9851bf769a922e2f100add37b60c4691d45d581258cfabbe94a0f38" }, { "members": [], "class_hash": "0x19a5c06b3a8417ff3f9883be3acb0e33c835795bd81fb87a5a47e6ed7d2d3af", - "tag": "mancala_fire-TrophyCreation", - "selector": "0x59bb5f857643aa3a53e33986f2d4a8c058a27722bfc7e0600b539e9e01ed5ee" + "tag": "mancala_wind-TrophyCreation", + "selector": "0x3bf133332485de1134a09e19df38e01e09b526c1a696747832e569ea756103d" }, { "members": [], "class_hash": "0x1922d2cd8b63eccf66321673234a52126cd9f0ab1bf6298c5abee6ee80c8990", - "tag": "mancala_fire-TrophyProgression", - "selector": "0x1a39af05bab4ba5329eb94147ccad983199cc8ea6103a08f1a82ceadbd0c7be" + "tag": "mancala_wind-TrophyProgression", + "selector": "0x3177e3deaecb1ad2f35c78a6637f5ef8c57e4fb085d5d4e9d289aac2800dd72" } ] } \ No newline at end of file diff --git a/contracts/src/constants.cairo b/contracts/src/constants.cairo index 1971f837..8ff880e7 100644 --- a/contracts/src/constants.cairo +++ b/contracts/src/constants.cairo @@ -1,5 +1,5 @@ pub fn NAMESPACE() -> ByteArray { - "mancala_fire" + "mancala_wind" } pub const TIMEOUT_DURATION: u64 = 360; diff --git a/contracts/torii_dev.toml b/contracts/torii_dev.toml index eec7b2c6..d32ee6db 100644 --- a/contracts/torii_dev.toml +++ b/contracts/torii_dev.toml @@ -2,7 +2,7 @@ rpc = "https://api.cartridge.gg/x/starknet/sepolia" allowed_origins = ["*"] # The World address to index. -world_address = "0xce27bfce81edb0d913ee4956e52d7000ac48a1dccf9dc5b8140653dd2257a9" +world_address = "0x07ccd70cdd217d66a7b6d2bf0a4ac6aecb9243996c2e55d21c8626f177860028" # Indexing Options [indexing] @@ -11,11 +11,11 @@ pending = true transactions = true polling_interval = 1000 contracts = [ - "erc721:0x07f413bd3ce6d349dd9efcd208894b9cd7b646979834ed771ffd62d160e25835" + "erc721:0x00c489b121fdc7bf7aa71167d603de7d41184576b6ed1bae87dd7b448c4ac8cf" ] [events] raw = true historical = [ - "mancala_fire-TrophyProgression", + "mancala_wind-TrophyProgression", ] From 2b382626e7db4c6d9c7735e9a43e52b770f8e734 Mon Sep 17 00:00:00 2001 From: Tony Stark Date: Mon, 24 Feb 2025 12:07:17 -0700 Subject: [PATCH 2/3] fix: display --- client/src/components/gameplay/game-board.tsx | 42 +++++++++---------- .../src/components/gameplay/game-message.tsx | 2 +- .../components/gameplay/game-navigation.tsx | 4 +- client/src/components/header.tsx | 10 ++--- client/src/components/message-area.tsx | 4 +- .../src/components/profile/user-section.tsx | 4 +- .../tutorial/tutorial-game-message.tsx | 2 +- .../tutorial/tutorial-game-navigation.tsx | 4 +- client/src/lib/config.ts | 2 +- client/src/lib/constants.ts | 32 +++++++------- client/src/pages/Lobby.tsx | 22 +++++----- client/src/pages/Tutorial.tsx | 6 +-- client/src/pages/games/Gameplay.tsx | 12 +++--- 13 files changed, 73 insertions(+), 73 deletions(-) diff --git a/client/src/components/gameplay/game-board.tsx b/client/src/components/gameplay/game-board.tsx index 91af6b1d..454b5355 100644 --- a/client/src/components/gameplay/game-board.tsx +++ b/client/src/components/gameplay/game-board.tsx @@ -36,13 +36,13 @@ const GameBoard: React.FC = ({ const [selectedPit, setSelectedPit] = React.useState(null); const [simulatedSeeds, setSimulatedSeeds] = React.useState([]); const [isSimulating, setIsSimulating] = React.useState(false); - const involved = game_players?.mancalaFirePlayerModels.edges.some( + const involved = game_players?.mancalaWindPlayerModels.edges.some( (item: any) => item?.node.address === (account.account?.address || game_node?.player_one), ); const player_position = involved - ? game_players?.mancalaFirePlayerModels.edges.findIndex( + ? game_players?.mancalaWindPlayerModels.edges.findIndex( (item: any) => item?.node.address === (account.account?.address || game_node?.player_one), @@ -74,7 +74,7 @@ const GameBoard: React.FC = ({ }, [startCapturePolling, startExtraTurnPolling]); useEffect(() => { - const captures = captureData?.mancalaFireCaptureModels?.edges; + const captures = captureData?.mancalaWindCaptureModels?.edges; if (captures && captures.length > 0 && game_node?.status !== "Finished") { const latestCapture = captures[captures.length - 1]?.node; @@ -97,7 +97,7 @@ const GameBoard: React.FC = ({ }, [captureData, account.account?.address, game_node?.status, setMessage]); useEffect(() => { - const extraTurns = extraTurnData?.mancalaFirePlayerExtraTurnModels?.edges; + const extraTurns = extraTurnData?.mancalaWindPlayerExtraTurnModels?.edges; if ( extraTurns && extraTurns.length > 0 && @@ -124,11 +124,11 @@ const GameBoard: React.FC = ({ }, [extraTurnData, account.account?.address, game_node?.status, setMessage]); const seeds = React.useMemo(() => { - if (!data?.mancalaFireSeedModels?.edges) return []; + if (!data?.mancalaWindSeedModels?.edges) return []; const uniqueSeeds = new Map(); // Sort edges by timestamp in descending order (newest first) - const sortedEdges = [...data.mancalaFireSeedModels.edges].sort((a, b) => { + const sortedEdges = [...data.mancalaWindSeedModels.edges].sort((a, b) => { const timeA = new Date(a.node.entity.updatedAt).getTime(); const timeB = new Date(b.node.entity.updatedAt).getTime(); return timeB - timeA; // Descending order @@ -169,10 +169,10 @@ const GameBoard: React.FC = ({ })); const player = - game_players?.mancalaFirePlayerModels.edges[player_position]?.node + game_players?.mancalaWindPlayerModels.edges[player_position]?.node .address; const opponent = - game_players?.mancalaFirePlayerModels.edges[opponent_position]?.node + game_players?.mancalaWindPlayerModels.edges[opponent_position]?.node .address; const simulatedMove = calculateMancalaMove( @@ -194,7 +194,7 @@ const GameBoard: React.FC = ({ ]); useEffect(() => { - if (data?.mancalaFireSeedModels?.edges) { + if (data?.mancalaWindSeedModels?.edges) { setIsSimulating(false); setSelectedPit(null); } @@ -246,14 +246,14 @@ const GameBoard: React.FC = ({ ? calculatePitAmount( simulatedSeeds, 7, - game_players?.mancalaFirePlayerModels.edges[player_position]?.node + game_players?.mancalaWindPlayerModels.edges[player_position]?.node .address, ) - : game_players?.mancalaFirePitModels.edges + : game_players?.mancalaWindPitModels.edges .filter( (item: any) => item?.node.player === - game_players?.mancalaFirePlayerModels.edges[player_position]?.node + game_players?.mancalaWindPlayerModels.edges[player_position]?.node .address, ) .filter((item: any) => item?.node.pit_number === 7)[0]?.node @@ -264,14 +264,14 @@ const GameBoard: React.FC = ({ ? calculatePitAmount( simulatedSeeds, 7, - game_players?.mancalaFirePlayerModels.edges[opponent_position]?.node + game_players?.mancalaWindPlayerModels.edges[opponent_position]?.node .address, ) - : game_players?.mancalaFirePitModels.edges + : game_players?.mancalaWindPitModels.edges .filter( (item: any) => item?.node.player === - game_players?.mancalaFirePlayerModels.edges[opponent_position] + game_players?.mancalaWindPlayerModels.edges[opponent_position] ?.node.address, ) .filter((item: any) => item?.node.pit_number === 7)[0]?.node @@ -324,11 +324,11 @@ const GameBoard: React.FC = ({ {/* Player 1 */}
- {game_players?.mancalaFirePitModels.edges + {game_players?.mancalaWindPitModels.edges .filter( (item: any) => item?.node.player === - game_players?.mancalaFirePlayerModels.edges[ + game_players?.mancalaWindPlayerModels.edges[ opponent_position ]?.node.address, ) @@ -340,7 +340,7 @@ const GameBoard: React.FC = ({ ? calculatePitAmount( simulatedSeeds, pit.node.pit_number, - game_players?.mancalaFirePlayerModels.edges[ + game_players?.mancalaWindPlayerModels.edges[ opponent_position ]?.node.address, ) @@ -359,11 +359,11 @@ const GameBoard: React.FC = ({ {/* Player 2 */}
- {game_players?.mancalaFirePitModels.edges + {game_players?.mancalaWindPitModels.edges .filter( (item: any) => item?.node.player === - game_players?.mancalaFirePlayerModels.edges[player_position] + game_players?.mancalaWindPlayerModels.edges[player_position] ?.node.address, ) .filter((item: any) => item?.node.pit_number !== 7) @@ -374,7 +374,7 @@ const GameBoard: React.FC = ({ ? calculatePitAmount( simulatedSeeds, pit.node.pit_number, - game_players?.mancalaFirePlayerModels.edges[ + game_players?.mancalaWindPlayerModels.edges[ player_position ]?.node.address, ) diff --git a/client/src/components/gameplay/game-message.tsx b/client/src/components/gameplay/game-message.tsx index 98d2e098..57ad65e7 100644 --- a/client/src/components/gameplay/game-message.tsx +++ b/client/src/components/gameplay/game-message.tsx @@ -79,7 +79,7 @@ export default function GameMessage({ normalizeAddress(account.account?.address); const user_position = - game_players?.mancalaFirePlayerModels?.edges?.find( + game_players?.mancalaWindPlayerModels?.edges?.find( (item: any) => item.node.address === normalizeAddress(game_node?.current_player), diff --git a/client/src/components/gameplay/game-navigation.tsx b/client/src/components/gameplay/game-navigation.tsx index 5fa8cbf2..527219d9 100644 --- a/client/src/components/gameplay/game-navigation.tsx +++ b/client/src/components/gameplay/game-navigation.tsx @@ -58,14 +58,14 @@ export default function GameNavigation({ }, [game_node]); const player_one_name = formatPlayerName( - player_names?.mancalaFireProfileModels.edges.find( + player_names?.mancalaWindProfileModels.edges.find( (item: any) => item.node.address === game_node?.player_one, )?.node.name, game_node?.player_one, ); const player_two_name = formatPlayerName( - player_names?.mancalaFireProfileModels.edges.find( + player_names?.mancalaWindProfileModels.edges.find( (item: any) => item.node.address === game_node?.player_two, )?.node.name, game_node?.player_two, diff --git a/client/src/components/header.tsx b/client/src/components/header.tsx index e295cfd9..84441775 100644 --- a/client/src/components/header.tsx +++ b/client/src/components/header.tsx @@ -89,7 +89,7 @@ export default function Header() { const [playerName, setPlayerName] = useState(""); useEffect(() => { - const profile: any = playerData?.mancalaFireProfileModels?.edges.find( + const profile: any = playerData?.mancalaWindProfileModels?.edges.find( (player: any) => player.node.address === account?.address, ); if (!account || !profile) { @@ -100,7 +100,7 @@ export default function Header() { if (profile?.node?.name) { setPlayerName(shortString.decodeShortString(profile?.node?.name)); } - }, [account, playerData?.mancalaFireProfileModels?.edges, playerData]); + }, [account, playerData?.mancalaWindProfileModels?.edges, playerData]); const handleTrophyClick = useCallback(() => { if (!connector?.controller) { @@ -157,7 +157,7 @@ export default function Header() { const [displayName, setDisplayName] = useState(""); const [initialDisplayName, setInitialDisplayName] = useState(""); const [initialImageUrl, setInitialImageUrl] = useState(""); - const profile: any = playerData?.mancalaFireProfileModels?.edges.find( + const profile: any = playerData?.mancalaWindProfileModels?.edges.find( (player: any) => player.node.address === account?.address, ); @@ -243,7 +243,7 @@ export default function Header() { setSaveStatus({ status: "saving", message: "Saving changes..." }); try { - const userExists = profiles.mancalaFireProfileModels.edges.some( + const userExists = profiles.mancalaWindProfileModels.edges.some( (profile: any) => profile.node.address === account?.address, ); @@ -298,7 +298,7 @@ export default function Header() { useEffect(() => { if ( account?.address && - playerData?.mancalaFireProfileModels?.edges && + playerData?.mancalaWindProfileModels?.edges && !profile ) { setOpen(true); diff --git a/client/src/components/message-area.tsx b/client/src/components/message-area.tsx index f326a679..eab75379 100644 --- a/client/src/components/message-area.tsx +++ b/client/src/components/message-area.tsx @@ -17,12 +17,12 @@ export default function MessageArea({ setAction, }: IMessageAreaProps) { const active_players_addrs = - game_players?.mancalaFirePlayerModels?.edges?.map( + game_players?.mancalaWindPlayerModels?.edges?.map( (item: any) => item?.node?.address, ) ?? []; const opponent_position = active_players_addrs.indexOf(address) === 0 ? 1 : 0; const opponent_requested_restart = - game_players?.mancalaFirePlayerModels?.edges?.filter( + game_players?.mancalaWindPlayerModels?.edges?.filter( (item: any) => item?.node?.restart_requested === true, )[opponent_position]?.node?.restart_requested; const { account } = useAccount(); diff --git a/client/src/components/profile/user-section.tsx b/client/src/components/profile/user-section.tsx index 5ad689a2..14b359ee 100644 --- a/client/src/components/profile/user-section.tsx +++ b/client/src/components/profile/user-section.tsx @@ -47,7 +47,7 @@ export default function UserSection({ const account = useAccount(); useEffect(() => { - const profile: any = playerData?.mancalaFireProfileModels?.edges.find( + const profile: any = playerData?.mancalaWindProfileModels?.edges.find( (player: any) => player.node.address === account?.account?.address, ); if (!account?.address || !profile) { @@ -137,7 +137,7 @@ export default function UserSection({ setSaveStatus({ status: "saving", message: "Saving changes..." }); try { - const userExists = profiles.mancalaFireProfileModels.edges.some( + const userExists = profiles.mancalaWindProfileModels.edges.some( (profile: any) => profile.node.address === account.account?.address, ); diff --git a/client/src/components/tutorial/tutorial-game-message.tsx b/client/src/components/tutorial/tutorial-game-message.tsx index 07063af5..11622aab 100644 --- a/client/src/components/tutorial/tutorial-game-message.tsx +++ b/client/src/components/tutorial/tutorial-game-message.tsx @@ -117,7 +117,7 @@ export default function TutorialGameMessage({ normalizeAddress(account.account?.address); const findPlayerProfile = (address: string) => { return ( - profiles?.mancalaFireProfileModels?.edges?.find( + profiles?.mancalaWindProfileModels?.edges?.find( (item: any) => normalizeAddress(item?.node.address) === normalizeAddress(address), diff --git a/client/src/components/tutorial/tutorial-game-navigation.tsx b/client/src/components/tutorial/tutorial-game-navigation.tsx index 2dbe9acc..bef1acbf 100644 --- a/client/src/components/tutorial/tutorial-game-navigation.tsx +++ b/client/src/components/tutorial/tutorial-game-navigation.tsx @@ -43,13 +43,13 @@ export default function TutorialGameNavigation({ game_players?.player_two?.edges?.[0]?.node?.address, ); const player_one_name = formatPlayerName( - player_names?.mancalaFireProfileModels.edges.find( + player_names?.mancalaWindProfileModels.edges.find( (item: any) => item.node.address === game_node?.player_one, )?.node.name, game_node?.player_one, ); const player_two_name = formatPlayerName( - player_names?.mancalaFireProfileModels.edges.find( + player_names?.mancalaWindProfileModels.edges.find( (item: any) => item.node.address === game_node?.player_two, )?.node.name, game_node?.player_two, diff --git a/client/src/lib/config.ts b/client/src/lib/config.ts index 800e4c96..5c335096 100644 --- a/client/src/lib/config.ts +++ b/client/src/lib/config.ts @@ -15,7 +15,7 @@ const PROFILE_ADDRESS = IS_MAINNET const CONFIG = { GRAPHQL_ENDPOINT: `${TORII_URL}/graphql`, SLOT_RPC_URL: RPC_URL, - SLOT: "mancala-fire", + SLOT: "mancala-wind", RPC_URL, TORII_URL, MASTER_ADDRESS: IS_MAINNET diff --git a/client/src/lib/constants.ts b/client/src/lib/constants.ts index ad4b2594..8a36b59f 100644 --- a/client/src/lib/constants.ts +++ b/client/src/lib/constants.ts @@ -612,8 +612,8 @@ export const normalizeAddress = (address: string) => { }; export const MancalaBoardModelsQuery = gql` - query mancalaFireMancalaBoardModels { - mancalaFireMancalaBoardModels { + query mancalaWindMancalaBoardModels { + mancalaWindMancalaBoardModels { edges { node { game_id @@ -633,8 +633,8 @@ export const MancalaBoardModelsQuery = gql` `; export const MancalaBoardModelQuery = gql` - query mancalaFireMancalaBoardModels($gameId: u128) { - mancalaFireMancalaBoardModels( + query mancalaWindMancalaBoardModels($gameId: u128) { + mancalaWindMancalaBoardModels( where: { game_id: $gameId } limit: 1000000000 ) { @@ -658,8 +658,8 @@ export const MancalaBoardModelQuery = gql` `; export const MancalaPlayQuery = gql` - query mancalaFirePlayerModels($gameId: u128) { - mancalaFirePlayerModels(where: { game_id: $gameId }, limit: 1000000000) { + query mancalaWindPlayerModels($gameId: u128) { + mancalaWindPlayerModels(where: { game_id: $gameId }, limit: 1000000000) { edges { node { address @@ -669,7 +669,7 @@ export const MancalaPlayQuery = gql` } } } - mancalaFirePitModels(where: { game_id: $gameId }, limit: 1000000000) { + mancalaWindPitModels(where: { game_id: $gameId }, limit: 1000000000) { edges { node { game_id @@ -683,8 +683,8 @@ export const MancalaPlayQuery = gql` `; export const MancalaSeedQuery = gql` - query mancalaFireSeedModels($gameId: u128) { - mancalaFireSeedModels(where: { game_id: $gameId }, limit: 1000000000) { + query mancalaWindSeedModels($gameId: u128) { + mancalaWindSeedModels(where: { game_id: $gameId }, limit: 1000000000) { edges { node { game_id @@ -704,7 +704,7 @@ export const MancalaSeedQuery = gql` export const MancalaHeaderQuery = gql` query FetchModelsForHeader { - mancalaFireGameModels(limit: 1000000000) { + mancalaWindGameModels(limit: 1000000000) { edges { node { game_id @@ -721,8 +721,8 @@ export const MancalaHeaderQuery = gql` `; export const MancalaPlayerNames = gql` - query mancalaFirePlayerNames { - mancalaFireProfileModels(limit: 1000000000) { + query mancalaWindPlayerNames { + mancalaWindProfileModels(limit: 1000000000) { edges { node { name @@ -735,8 +735,8 @@ export const MancalaPlayerNames = gql` `; export const MancalaCaptureQuery = gql` - query mancalaFireCaptureModels($gameId: u128) { - mancalaFireCaptureModels(where: { game_id: $gameId }, limit: 1000000000) { + query mancalaWindCaptureModels($gameId: u128) { + mancalaWindCaptureModels(where: { game_id: $gameId }, limit: 1000000000) { edges { node { game_id @@ -750,8 +750,8 @@ export const MancalaCaptureQuery = gql` `; export const MancalaExtraTurnQuery = gql` - query mancalaFirePlayerExtraTurnModels($gameId: u128) { - mancalaFirePlayerExtraTurnModels( + query mancalaWindPlayerExtraTurnModels($gameId: u128) { + mancalaWindPlayerExtraTurnModels( where: { game_id: $gameId } limit: 1000000000 ) { diff --git a/client/src/pages/Lobby.tsx b/client/src/pages/Lobby.tsx index fc7309cc..35f7d279 100644 --- a/client/src/pages/Lobby.tsx +++ b/client/src/pages/Lobby.tsx @@ -94,7 +94,7 @@ export default function Lobby() { const { data: playerData, startPolling: startPollingPlayerData } = useQuery(MancalaPlayerNames); startPollingPlayerData(1000); - const filteredGames = data?.mancalaFireMancalaBoardModels?.edges + const filteredGames = data?.mancalaWindMancalaBoardModels?.edges ?.filter( (game: any) => game?.node?.player_one === account?.address || @@ -120,14 +120,14 @@ export default function Lobby() { return 0; }) .map((game: any) => { - const player1Profile = playerData?.mancalaFireProfileModels?.edges?.find( + const player1Profile = playerData?.mancalaWindProfileModels?.edges?.find( (profile: any) => profile.node.address === game.node.player_one, ); - const player2Profile = playerData?.mancalaFireProfileModels?.edges?.find( + const player2Profile = playerData?.mancalaWindProfileModels?.edges?.find( (profile: any) => profile.node.address === game.node.player_two, ); - const winner = playerData?.mancalaFireProfileModels?.edges?.find( + const winner = playerData?.mancalaWindProfileModels?.edges?.find( (profile: any) => profile.node.address === game.node.winner, ); return { @@ -145,7 +145,7 @@ export default function Lobby() { }); const filteredTransactions = - data?.mancalaFireMancalaBoardModels?.edges?.reduce( + data?.mancalaWindMancalaBoardModels?.edges?.reduce( (acc: any[], game: any) => { if ( game?.node?.player_one === account?.address || @@ -185,12 +185,12 @@ export default function Lobby() { // }; // }, [isPlaying]); - const gamesWithPlayerNames = data?.mancalaFireMancalaBoardModels?.edges + const gamesWithPlayerNames = data?.mancalaWindMancalaBoardModels?.edges ?.map((game: any) => { - const player1Profile = playerData?.mancalaFireProfileModels?.edges?.find( + const player1Profile = playerData?.mancalaWindProfileModels?.edges?.find( (profile: any) => profile.node.address === game.node.player_one, ); - const player2Profile = playerData?.mancalaFireProfileModels?.edges?.find( + const player2Profile = playerData?.mancalaWindProfileModels?.edges?.find( (profile: any) => profile.node.address === game.node.player_two, ); return { @@ -219,8 +219,8 @@ export default function Lobby() { const [tabValue, setTabValue] = useState("duels"); useEffect(() => { - if (data?.mancalaFireMancalaBoardModels?.edges) { - const allAddresses = data?.mancalaFireMancalaBoardModels.edges + if (data?.mancalaWindMancalaBoardModels?.edges) { + const allAddresses = data?.mancalaWindMancalaBoardModels.edges .flatMap((game: any) => [ game.node.player_one, game.node.player_two, @@ -230,7 +230,7 @@ export default function Lobby() { lookupMissingNames(allAddresses, setAddressLookupCache); } - }, [data?.mancalaFireMancalaBoardModels.edges]); + }, [data?.mancalaWindMancalaBoardModels.edges]); return (
diff --git a/client/src/pages/Tutorial.tsx b/client/src/pages/Tutorial.tsx index 60fff2a6..0d835615 100644 --- a/client/src/pages/Tutorial.tsx +++ b/client/src/pages/Tutorial.tsx @@ -31,7 +31,7 @@ export default function Tutorial() { const { data: player_names } = useQuery(MancalaPlayerNames); const { system } = useDojo(); const game_node = - game_metadata?.mancalaFireMancalaBoardModels?.edges?.[0]?.node; + game_metadata?.mancalaWindMancalaBoardModels?.edges?.[0]?.node; const account = useAccount(); const [moveMessage, setMoveMessage] = useState( "Great! Now watch how seeds are distributed: Pick up all seeds from your pit and sow them one by one counter-clockwise", @@ -93,8 +93,8 @@ export default function Tutorial() { undefined} - game_node={game_node} + setMessage={() => undefined} + game_node={game_node} game_players={game_players} />
diff --git a/client/src/pages/games/Gameplay.tsx b/client/src/pages/games/Gameplay.tsx index 9ed6b542..79f58618 100644 --- a/client/src/pages/games/Gameplay.tsx +++ b/client/src/pages/games/Gameplay.tsx @@ -38,23 +38,23 @@ export default function Gameplay() { const { data: player_names } = useQuery(MancalaPlayerNames); const { system } = useDojo(); const game_node = - game_metadata?.mancalaFireMancalaBoardModels?.edges?.[0]?.node; + game_metadata?.mancalaWindMancalaBoardModels?.edges?.[0]?.node; const account = useAccount(); const [moveMessage, setMoveMessage] = useState(); const involved = - game_players?.mancalaFirePlayerModels.edges.filter( + game_players?.mancalaWindPlayerModels.edges.filter( (item: any) => item?.node.address === account.address, ).length > 0 ? true : false; const player_position = involved - ? game_players?.mancalaFirePlayerModels.edges.findIndex( + ? game_players?.mancalaWindPlayerModels.edges.findIndex( (item: any) => item?.node.address === account.address, ) : 0; const opponent_position = player_position === 0 ? 1 : 0; const opposition_address = - game_players?.mancalaFirePlayerModels.edges[opponent_position]?.node + game_players?.mancalaWindPlayerModels.edges[opponent_position]?.node .address; startMetadataPolling(100); startPlayersPolling(100); @@ -108,8 +108,8 @@ export default function Gameplay() { gameId={gameId || ""} opposition_address={opposition_address} setMessage={setMessage} - game_node={game_node} - game_players={game_players} + game_node={game_node} + game_players={game_players} />
From 1b88295a1f58b07f5eff7d3397124a1ab1857c95 Mon Sep 17 00:00:00 2001 From: Tony Stark Date: Mon, 24 Feb 2025 12:24:58 -0700 Subject: [PATCH 3/3] feat: added pass address --- client/src/Checks.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/Checks.tsx b/client/src/Checks.tsx index cf62f0ea..7de3a882 100644 --- a/client/src/Checks.tsx +++ b/client/src/Checks.tsx @@ -24,7 +24,7 @@ export default function Checks({ children }: { children: React.ReactNode }) { connect({ connector: connectors[0] }); } const contract_address = - "0x07f413bd3ce6d349dd9efcd208894b9cd7b646979834ed771ffd62d160e25835"; + "0x00c489b121fdc7bf7aa71167d603de7d41184576b6ed1bae87dd7b448c4ac8cf"; const { abi } = await provider.getClassAt(contract_address); const contract = new Contract(abi, contract_address, provider); contract.connect(account as AccountInterface);