From 7af0860a8190eb334d574e90487ff5a45f47a6ef Mon Sep 17 00:00:00 2001 From: Nasr Date: Mon, 14 Apr 2025 10:28:52 +0900 Subject: [PATCH 1/6] fix(torii-relay): to support nodejs env --- Cargo.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 01d256b..c72de97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ version = "1.3.1" crate-type = ["cdylib", "rlib", "staticlib"] [dependencies] -dojo-world = { git = "https://github.com/dojoengine/dojo", rev = "2348232" } -dojo-types = { git = "https://github.com/dojoengine/dojo", rev = "2348232" } -torii-client = { git = "https://github.com/dojoengine/dojo", rev = "2348232" } -torii-grpc = { git = "https://github.com/dojoengine/dojo", features = [ +dojo-world = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} +dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} +torii-client = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} +torii-grpc = { git = "https://github.com/Larkooo/dojo", features = [ "client", -], rev = "2348232" } -torii-typed-data = { git = "https://github.com/dojoengine/dojo", rev = "2348232" } -torii-relay = { git = "https://github.com/dojoengine/dojo", rev = "2348232" } +], branch = "no-webrtc-node"} +torii-typed-data = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} +torii-relay = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} starknet = "0.13.0" starknet-crypto = "0.7.2" From b51f6bbfe1f6922af66f11116a6ee3072da5d297 Mon Sep 17 00:00:00 2001 From: Valentin Dosimont Date: Wed, 16 Apr 2025 10:25:18 +0200 Subject: [PATCH 2/6] fix: build errors --- Cargo.lock | 66 ++++++++++++++++++++++------------------------- Cargo.toml | 34 ++++++++++++------------ src/wasm/types.rs | 3 +-- 3 files changed, 49 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85db283..a188418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1761,7 +1761,7 @@ dependencies = [ [[package]] name = "dojo-types" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "anyhow", "cainome 0.5.0", @@ -1783,7 +1783,7 @@ dependencies = [ [[package]] name = "dojo-world" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "anyhow", "async-trait", @@ -3158,9 +3158,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -5546,12 +5546,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scopeguard" version = "1.2.0" @@ -7191,7 +7185,7 @@ dependencies = [ [[package]] name = "torii-client" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "async-trait", "crypto-bigint", @@ -7219,7 +7213,7 @@ dependencies = [ [[package]] name = "torii-grpc" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "crypto-bigint", "dojo-types", @@ -7258,7 +7252,7 @@ dependencies = [ [[package]] name = "torii-relay" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "anyhow", "futures", @@ -7273,12 +7267,13 @@ dependencies = [ "thiserror 1.0.69", "torii-typed-data", "tracing", + "web-sys", ] [[package]] name = "torii-typed-data" version = "1.4.0" -source = "git+https://github.com/dojoengine/dojo?rev=2348232#234823291281c6522ff6a48ea5739d85d59bcdf9" +source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" dependencies = [ "cainome 0.5.0", "crypto-bigint", @@ -7753,24 +7748,24 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -7779,9 +7774,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.47" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -7792,9 +7787,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7802,9 +7797,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", @@ -7815,20 +7810,21 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-bindgen-test" -version = "0.3.47" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d919bb60ebcecb9160afee6c71b43a58a4f0517a2de0054cd050d02cec08201" +checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3" dependencies = [ "js-sys", "minicov", - "once_cell", - "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-test-macro", @@ -7836,9 +7832,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.47" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222ebde6ea87fbfa6bdd2e9f1fd8a91d60aee5db68792632176c4e16a74fc7d8" +checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b" dependencies = [ "proc-macro2", "quote", @@ -7860,9 +7856,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.74" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index c72de97..aff5f63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ version = "1.3.1" crate-type = ["cdylib", "rlib", "staticlib"] [dependencies] -dojo-world = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} -dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} -torii-client = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} +dojo-world = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } +dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } +torii-client = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } torii-grpc = { git = "https://github.com/Larkooo/dojo", features = [ - "client", -], branch = "no-webrtc-node"} -torii-typed-data = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} -torii-relay = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node"} + "client", +], branch = "no-webrtc-node" } +torii-typed-data = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } +torii-relay = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } starknet = "0.13.0" starknet-crypto = "0.7.2" @@ -37,13 +37,13 @@ account_sdk = { git = "https://github.com/cartridge-gg/controller", rev = "dbbe0 serde-wasm-bindgen = "0.6.3" wasm-bindgen-futures = "0.4.39" -js-sys = "0.3.70" -web-sys = { version = "0.3.70", features = [ - 'MessageEvent', - 'Window', - 'Worker', - 'WorkerGlobalScope', - 'console', +js-sys = "0.3.77" +web-sys = { version = "0.3.77", features = [ + 'MessageEvent', + 'Window', + 'Worker', + 'WorkerGlobalScope', + 'console', ] } crypto-bigint = "0.5.5" tsify-next = { version = "0.5.4", features = ["js"] } @@ -57,9 +57,9 @@ axum = "0.8.1" open = "5.3.2" urlencoding = "2.1.3" keyring = { version = "3.6.1", features = [ - "apple-native", - "windows-native", - "sync-secret-service", + "apple-native", + "windows-native", + "sync-secret-service", ] } directories = "6.0.0" tower-http = { version = "0.6.2", features = ["cors"] } diff --git a/src/wasm/types.rs b/src/wasm/types.rs index 3ee696b..4fc97d3 100644 --- a/src/wasm/types.rs +++ b/src/wasm/types.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use starknet::core::types::FunctionCall; use starknet::core::utils::get_selector_from_name; use starknet_crypto::Felt; -use tsify_next::{declare, Tsify}; +use tsify_next::{Tsify, declare}; use wasm_bindgen::prelude::*; use super::utils::{pad_to_hex, parse_ty_as_json_str}; @@ -159,7 +159,6 @@ pub struct ClientConfig { #[wasm_bindgen] impl ClientConfig { - #[wasm_bindgen(constructor)] pub fn new(torii_url: String, relay_url: String, world_address: String) -> Self { Self { torii_url, relay_url, world_address } } From 962f918e415bffed28e5730d6df724a5495e2b4a Mon Sep 17 00:00:00 2001 From: Nasr Date: Wed, 16 Apr 2025 17:30:46 +0900 Subject: [PATCH 3/6] switch back to main --- Cargo.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index aff5f63..5abb8d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ version = "1.3.1" crate-type = ["cdylib", "rlib", "staticlib"] [dependencies] -dojo-world = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } -dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } -torii-client = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } -torii-grpc = { git = "https://github.com/Larkooo/dojo", features = [ +dojo-world = { git = "https://github.com/dojoengine/dojo", rev = "6300eb4" } +dojo-types = { git = "https://github.com/dojoengine/dojo", rev = "6300eb4" } +torii-client = { git = "https://github.com/dojoengine/dojo", rev = "6300eb4" } +torii-grpc = { git = "https://github.com/dojoengine/dojo", features = [ "client", -], branch = "no-webrtc-node" } -torii-typed-data = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } -torii-relay = { git = "https://github.com/Larkooo/dojo", branch = "no-webrtc-node" } +], rev = "6300eb4" } +torii-typed-data = { git = "https://github.com/dojoengine/dojo", rev = "6300eb4" } +torii-relay = { git = "https://github.com/dojoengine/dojo", rev = "6300eb4" } starknet = "0.13.0" starknet-crypto = "0.7.2" From 478645826ee9a2aecb488027165b09f4d11e4e6a Mon Sep 17 00:00:00 2001 From: Nasr Date: Wed, 16 Apr 2025 17:31:55 +0900 Subject: [PATCH 4/6] fmt --- src/wasm/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wasm/types.rs b/src/wasm/types.rs index 4fc97d3..2e11516 100644 --- a/src/wasm/types.rs +++ b/src/wasm/types.rs @@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize}; use starknet::core::types::FunctionCall; use starknet::core::utils::get_selector_from_name; use starknet_crypto::Felt; -use tsify_next::{Tsify, declare}; +use tsify_next::{declare, Tsify}; use wasm_bindgen::prelude::*; use super::utils::{pad_to_hex, parse_ty_as_json_str}; From 5a6f52cae920729fb185daa8fadd65e8e813d31c Mon Sep 17 00:00:00 2001 From: Nasr Date: Wed, 16 Apr 2025 17:34:12 +0900 Subject: [PATCH 5/6] lock bump --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a188418..70af854 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1760,8 +1760,8 @@ dependencies = [ [[package]] name = "dojo-types" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "anyhow", "cainome 0.5.0", @@ -1782,8 +1782,8 @@ dependencies = [ [[package]] name = "dojo-world" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "anyhow", "async-trait", @@ -7184,8 +7184,8 @@ dependencies = [ [[package]] name = "torii-client" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "async-trait", "crypto-bigint", @@ -7212,8 +7212,8 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "crypto-bigint", "dojo-types", @@ -7251,8 +7251,8 @@ dependencies = [ [[package]] name = "torii-relay" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "anyhow", "futures", @@ -7272,8 +7272,8 @@ dependencies = [ [[package]] name = "torii-typed-data" -version = "1.4.0" -source = "git+https://github.com/Larkooo/dojo?branch=no-webrtc-node#22947306b47b7a05dd7c7e06e2897e4c027ba17a" +version = "1.4.1" +source = "git+https://github.com/dojoengine/dojo?rev=6300eb4#6300eb467bb245e2455f31846f7cacf213dbf9e0" dependencies = [ "cainome 0.5.0", "crypto-bigint", From 203304c465a2d11f60b428a7bdd26bcb763e0ea1 Mon Sep 17 00:00:00 2001 From: Nasr Date: Wed, 16 Apr 2025 17:35:33 +0900 Subject: [PATCH 6/6] remove wasm bindgen from clientocnfig --- src/wasm/types.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/wasm/types.rs b/src/wasm/types.rs index 2e11516..0cf9421 100644 --- a/src/wasm/types.rs +++ b/src/wasm/types.rs @@ -157,13 +157,6 @@ pub struct ClientConfig { pub world_address: String, } -#[wasm_bindgen] -impl ClientConfig { - pub fn new(torii_url: String, relay_url: String, world_address: String) -> Self { - Self { torii_url, relay_url, world_address } - } -} - #[derive(Tsify, Serialize, Deserialize, Debug)] #[tsify(into_wasm_abi, from_wasm_abi, hashmap_as_object)] pub struct Ty {