diff --git a/src/lib.rs b/src/lib.rs index fd7abea..61ff93e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,6 @@ mod utils; #[cfg(not(target_arch = "wasm32"))] mod c; -#[cfg(target_arch = "wasm32")] +// #[cfg(target_arch = "wasm32")] /// cbindgen:ignore mod wasm; diff --git a/src/wasm/mod.rs b/src/wasm/mod.rs index 429b706..481ac09 100644 --- a/src/wasm/mod.rs +++ b/src/wasm/mod.rs @@ -61,9 +61,6 @@ pub struct SigningKey(starknet::signers::SigningKey); #[wasm_bindgen] pub struct VerifyingKey(starknet::signers::VerifyingKey); -#[wasm_bindgen] -pub struct TypedData(torii_typed_data::TypedData); - #[wasm_bindgen] pub struct ByteArray(cainome::cairo_serde::ByteArray); diff --git a/src/wasm/types.rs b/src/wasm/types.rs index eced59b..e525dfd 100644 --- a/src/wasm/types.rs +++ b/src/wasm/types.rs @@ -427,6 +427,21 @@ pub struct KeysClause { pub models: Vec, } +#[derive(Tsify, Serialize, Deserialize, Debug)] +#[tsify(into_wasm_abi, from_wasm_abi, hashmap_as_object)] +pub struct TypedData { + pub domain: + pub message: String, + pub primary_type: String, + pub types: String, +} + +impl From for torii_typed_data::TypedData { + fn from(value: TypedData) -> Self { + Self { domain: value.domain.into(), message: value.message.into(), primary_type: value.primary_type.into(), types: value.types.into() } + } +} + #[declare] pub type KeysClauses = Vec;