diff --git a/crates/torii/client/abigen/world.json b/crates/torii/client/abigen/world.json index 53eaef788e..9f0212b406 100644 --- a/crates/torii/client/abigen/world.json +++ b/crates/torii/client/abigen/world.json @@ -69,7 +69,12 @@ { "type": "function", "name": "metadata_uri", - "inputs": [], + "inputs": [ + { + "name": "resource", + "type": "core::felt252" + } + ], "outputs": [ { "type": "core::array::Span::" @@ -81,6 +86,10 @@ "type": "function", "name": "set_metadata_uri", "inputs": [ + { + "name": "resource", + "type": "core::felt252" + }, { "name": "uri", "type": "core::array::Span::" @@ -315,7 +324,7 @@ "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "target", + "name": "resource", "type": "core::felt252" } ], @@ -335,7 +344,7 @@ "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "target", + "name": "resource", "type": "core::felt252" } ], @@ -351,7 +360,7 @@ "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "target", + "name": "resource", "type": "core::felt252" } ], @@ -412,6 +421,20 @@ } ] }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "executor", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "contract_base", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, { "type": "event", "name": "dojo::world::world::WorldSpawned", @@ -423,12 +446,24 @@ "kind": "data" }, { - "name": "caller", + "name": "creator", "type": "core::starknet::contract_address::ContractAddress", "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::world::world::MetadataUpdate", + "kind": "struct", + "members": [ + { + "name": "resource", + "type": "core::felt252", + "kind": "data" }, { - "name": "metadata_uri", + "name": "uri", "type": "core::array::Span::", "kind": "data" } @@ -505,6 +540,11 @@ "type": "dojo::world::world::WorldSpawned", "kind": "nested" }, + { + "name": "MetadataUpdate", + "type": "dojo::world::world::MetadataUpdate", + "kind": "nested" + }, { "name": "ModelRegistered", "type": "dojo::world::world::ModelRegistered", diff --git a/crates/torii/client/src/contract/world.rs b/crates/torii/client/src/contract/world.rs index 0bf73c4bd9..ade3c2faae 100644 --- a/crates/torii/client/src/contract/world.rs +++ b/crates/torii/client/src/contract/world.rs @@ -36,7 +36,7 @@ pub enum WorldContractError { impl<'a, A: ConnectedAccount + Sync> WorldContract<'a, A> { pub async fn set_metadata_uri_from_str( &self, - resource: FieldElement, + resource: &FieldElement, metadata_uri: String, ) -> Result< InvokeTransactionResult, @@ -57,9 +57,8 @@ impl<'a, A: ConnectedAccount + Sync> WorldContract<'a, A> { .collect::>(); encoded.insert(0, encoded.len().into()); - encoded.insert(0, resource); - self.set_metadata_uri(&encoded).await.map_err(WorldContractError::AccountError) + self.set_metadata_uri(resource, &encoded).await.map_err(WorldContractError::AccountError) } pub async fn grant_writer_from_str(